diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-05-14 20:13:24 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 080487c961b424c9dd822d38ec8c2c4d79aff24b (patch) | |
tree | 2380205a466eee8837d62f599b83a3a50c41d7c1 /src/sql/Sql.cpp | |
parent | 4241bcd4e14095e4340a0300e205f6fdc503f1d8 (diff) |
Only download nodes that we are missing
Diffstat (limited to 'src/sql/Sql.cpp')
-rw-r--r-- | src/sql/Sql.cpp | 21 |
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; + } +} |