aboutsummaryrefslogtreecommitdiff
path: root/src/sql/Sql.cpp
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-05-14 20:13:24 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-14 20:13:27 +0200
commit8daf7b3165c65a932a7d8eae1f0a640199892ca9 (patch)
treec6d44529e4e2e0808841366f112700a0bb3d1bfd /src/sql/Sql.cpp
parent1fe14e8fcfbec25cb6b70df194a82ede4cc0a3e5 (diff)
Only download nodes that we are missing
Diffstat (limited to 'src/sql/Sql.cpp')
-rw-r--r--src/sql/Sql.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/sql/Sql.cpp b/src/sql/Sql.cpp
new file mode 100644
index 0000000..754a30d
--- /dev/null
+++ b/src/sql/Sql.cpp
@@ -0,0 +1,21 @@
+#include "../../include/odhtdb/sql/Sql.hpp"
+#include <sqlite3.h>
+
+namespace odhtdb
+{
+ int SqlArg::bind(sqlite3_stmt *stmt, int paramIndex) const
+ {
+ switch(type)
+ {
+ case Type::DATA_VIEW:
+ return sqlite3_bind_blob(stmt, paramIndex, dataView.data, dataView.size, SQLITE_STATIC);
+ case Type::INT:
+ return sqlite3_bind_int(stmt, paramIndex, integer);
+ case Type::INT64:
+ return sqlite3_bind_int64(stmt, paramIndex, integer64);
+ case Type::UINT64: // TODO: Find a way to use u64 in sqlite
+ return sqlite3_bind_int64(stmt, paramIndex, uinteger64);
+ }
+ return SQLITE_OK;
+ }
+}