libdballe  7.6
sqlite/datav6.h
Go to the documentation of this file.
1 /*
2  * db/v6/data - data table management
3  *
4  * Copyright (C) 2005--2014 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 
22 #ifndef DBALLE_DB_SQLITE_V6_DATA_H
23 #define DBALLE_DB_SQLITE_V6_DATA_H
24 
31 #include <dballe/db/sql/datav6.h>
32 #include <dballe/db/sqlite/internals.h>
33 
34 namespace dballe {
35 struct Record;
36 
37 namespace db {
38 namespace sqlite {
39 struct DB;
40 
44 class SQLiteDataV6 : public sql::DataV6
45 {
46 protected:
49 
51  SQLiteStatement* sstm = nullptr;
52 
53 public:
55  SQLiteDataV6(const SQLiteDataV6&) = delete;
56  SQLiteDataV6(const SQLiteDataV6&&) = delete;
57  SQLiteDataV6& operator=(const SQLiteDataV6&) = delete;
58  ~SQLiteDataV6();
59 
60  void insert(Transaction& t, sql::bulk::InsertV6& vars, UpdateMode update_mode=UPDATE) override;
61  void remove(const v6::QueryBuilder& qb) override;
62  void dump(FILE* out) override;
63 };
64 
65 }
66 }
67 }
68 #endif
SQLiteStatement * sstm
Precompiled select statement to prepare bulk insert.
Definition: sqlite/datav6.h:51
SQLite statement.
Definition: sqlite/internals.h:124
Database connection.
Definition: sqlite/internals.h:56
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
void insert(Transaction &t, sql::bulk::InsertV6 &vars, UpdateMode update_mode=UPDATE) override
Bulk variable insert.
Attribute table management used by the db module.
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
A RAII transaction interface.
Definition: sql.h:134
Input for a bulk insert of a lot of variables sharing the same context information.
Definition: sql/datav6.h:133
Precompiled query to manipulate the data table.
Definition: sqlite/datav6.h:44
Build SQL queries for V6 databases.
Definition: qbuilder.h:15
SQLiteConnection & conn
DB connection.
Definition: sqlite/datav6.h:48
Precompiled query to manipulate the data table.
Definition: sql/datav6.h:57