aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/sqlite.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-09 14:27:30 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-10 18:05:35 +0200
commitf294623d1d2d42cd6671c061d3e146b05b930afb (patch)
tree9217e9bb453beb37b8bf3d4610e47e7e9fa5b211 /src/libstore/sqlite.hh
parent6cb4bdf1526bacb02fec015f89267e519b654b84 (diff)
SQLite:: Add some convenience
Diffstat (limited to 'src/libstore/sqlite.hh')
-rw-r--r--src/libstore/sqlite.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh
index d6b4a8d91..7c1ed5382 100644
--- a/src/libstore/sqlite.hh
+++ b/src/libstore/sqlite.hh
@@ -13,10 +13,16 @@ namespace nix {
/* RAII wrapper to close a SQLite database automatically. */
struct SQLite
{
- sqlite3 * db;
- SQLite() { db = 0; }
+ sqlite3 * db = 0;
+ SQLite() { }
+ SQLite(const Path & path);
+ SQLite(const SQLite & from) = delete;
+ SQLite& operator = (const SQLite & from) = delete;
+ SQLite& operator = (SQLite && from) { db = from.db; from.db = 0; return *this; }
~SQLite();
operator sqlite3 * () { return db; }
+
+ void exec(const std::string & stmt);
};
/* RAII wrapper to create and destroy SQLite prepared statements. */