aboutsummaryrefslogtreecommitdiff
path: root/src/sql/Sql.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-14 20:13:24 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit080487c961b424c9dd822d38ec8c2c4d79aff24b (patch)
tree2380205a466eee8837d62f599b83a3a50c41d7c1 /src/sql/Sql.cpp
parent4241bcd4e14095e4340a0300e205f6fdc503f1d8 (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;
+ }
+}