From 080487c961b424c9dd822d38ec8c2c4d79aff24b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 14 May 2018 20:13:24 +0200 Subject: Only download nodes that we are missing --- src/sql/Sql.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/sql/Sql.cpp (limited to 'src/sql/Sql.cpp') 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 + +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; + } +} -- cgit v1.2.3