mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-07-04 14:24:10 +00:00
Create intermediate backend lib to help loading backend plugins.
This commit is contained in:
parent
1fd51f75ba
commit
064fc0cf1a
11 changed files with 429 additions and 4 deletions
49
src/backends/postgresql/backend_postgresql.hpp
Normal file
49
src/backends/postgresql/backend_postgresql.hpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* Copyright 2015, 2016, Michele Santullo
|
||||
* This file is part of "dindexer".
|
||||
*
|
||||
* "dindexer" is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* "dindexer" is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef idBE5BBAFEC7334F39AC9338F193703341
|
||||
#define idBE5BBAFEC7334F39AC9338F193703341
|
||||
|
||||
#include "backends/db_backend.hpp"
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace pq {
|
||||
class Connection;
|
||||
} //namespace pq
|
||||
|
||||
namespace dindb {
|
||||
class BackendPostgreSql : public Backend {
|
||||
public:
|
||||
BackendPostgreSql ( BackendPostgreSql&& ) = default;
|
||||
BackendPostgreSql ( std::string&& parUser, std::string&& parPass, std::string&& parDB, std::string&& parAddr, uint16_t parPort );
|
||||
virtual ~BackendPostgreSql ( void ) noexcept;
|
||||
|
||||
virtual void tag_files ( const std::vector<FileIDType>& parFiles, const std::vector<boost::string_ref>& parTags, GroupIDType parSet ) const override;
|
||||
virtual void tag_files ( const std::vector<std::string>& parRegexes, const std::vector<boost::string_ref>& parTags, GroupIDType parSet ) const override;
|
||||
virtual void delete_tags ( const std::vector<FileIDType>& parFiles, const std::vector<boost::string_ref>& parTags, GroupIDType parSet ) const override;
|
||||
virtual void delete_tags ( const std::vector<std::string>& parRegexes, const std::vector<boost::string_ref>& parTags, GroupIDType parSet ) const override;
|
||||
virtual void delete_all_tags ( const std::vector<FileIDType>& parFiles, GroupIDType parSet ) const override;
|
||||
virtual void delete_all_tags ( const std::vector<std::string>& parRegexes, GroupIDType parSet ) const override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<pq::Connection> m_conn;
|
||||
};
|
||||
} //namespace dindb
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue