libdballe  7.6
postgresql/driver.h
1 /*
2  * db/postgresql/driver - Backend PostgreSQL driver
3  *
4  * Copyright (C) 2015 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Author: Enrico Zini <enrico@enricozini.com>
20  */
21 #ifndef DBALLE_DB_POSTGRESQL_DRIVER_H
22 #define DBALLE_DB_POSTGRESQL_DRIVER_H
23 
24 #include <dballe/db/sql/driver.h>
25 
26 namespace dballe {
27 namespace db {
28 struct PostgreSQLConnection;
29 
30 namespace postgresql {
31 
32 struct Driver : public sql::Driver
33 {
35 
37  virtual ~Driver();
38 
39  std::unique_ptr<sql::Repinfo> create_repinfov6() override;
40  std::unique_ptr<sql::Station> create_stationv6() override;
41  std::unique_ptr<sql::LevTr> create_levtrv6() override;
42  std::unique_ptr<sql::DataV6> create_datav6() override;
43  std::unique_ptr<sql::AttrV6> create_attrv6() override;
44  void run_built_query_v6(const v6::QueryBuilder& qb, std::function<void(sql::SQLRecordV6& rec)> dest) override;
45  void create_tables_v6() override;
46  void delete_tables_v6() override;
47  void vacuum_v6() override;
48  void exec_no_data(const std::string& query) override;
49  void explain(const std::string& query) override;
50 };
51 
52 }
53 }
54 }
55 
56 #endif
Attribute table management used by the db module.
std::unique_ptr< sql::LevTr > create_levtrv6() override
Precompiled queries to manipulate the levtr table.
std::unique_ptr< sql::AttrV6 > create_attrv6() override
Precompiled queries to manipulate the attr table.
void create_tables_v6() override
Create all missing tables for V6 databases.
std::unique_ptr< sql::DataV6 > create_datav6() override
Precompiled queries to manipulate the data table.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Query results from SQL output.
Definition: sql/driver.h:56
std::unique_ptr< sql::Repinfo > create_repinfov6() override
Precompiled queries to manipulate the repinfo table.
void delete_tables_v6() override
Delete all existing tables for V6 databases.
std::unique_ptr< sql::Station > create_stationv6() override
Precompiled queries to manipulate the station table.
Database connection.
Definition: postgresql/internals.h:249
void vacuum_v6() override
Perform database cleanup/maintenance on v6 databases.
Definition: sql/driver.h:84
Definition: postgresql/driver.h:32
Build SQL queries for V6 databases.
Definition: qbuilder.h:15
void exec_no_data(const std::string &query) override
Run a SQL query that is expected to return no data.
void explain(const std::string &query) override
Outputs to stderr an explanation of the given query.