aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/sqlite.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-03-24 14:26:13 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-03-24 14:34:47 +0100
commit0a10854f857e519d1455ff0f0be1f8401c40a11c (patch)
tree64cd9b1c0727eb0642574e4535c5ba61af497c3a /src/libstore/sqlite.hh
parentc85097da7c1ef06e2f1912c922110ff358de3aa2 (diff)
Misc changes from the flakes branch
Diffstat (limited to 'src/libstore/sqlite.hh')
-rw-r--r--src/libstore/sqlite.hh10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh
index bd012d9b9..fd04c9b07 100644
--- a/src/libstore/sqlite.hh
+++ b/src/libstore/sqlite.hh
@@ -5,8 +5,8 @@
#include "types.hh"
-class sqlite3;
-class sqlite3_stmt;
+struct sqlite3;
+struct sqlite3_stmt;
namespace nix {
@@ -15,13 +15,16 @@ struct SQLite
{
sqlite3 * db = 0;
SQLite() { }
- SQLite(const Path & path);
+ SQLite(const Path & path, bool create = true);
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; }
+ /* Disable synchronous mode, set truncate journal mode. */
+ void isCache();
+
void exec(const std::string & stmt);
};
@@ -52,6 +55,7 @@ struct SQLiteStmt
/* Bind the next parameter. */
Use & operator () (const std::string & value, bool notNull = true);
+ Use & operator () (const unsigned char * data, size_t len, bool notNull = true);
Use & operator () (int64_t value, bool notNull = true);
Use & bind(); // null