From 0600cacfadf00e916340f2394f1d3bfc173a3d0b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 9 Jul 2023 15:53:11 +0200 Subject: store process output in SQLite --- src/sqlite.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/sqlite.c') diff --git a/src/sqlite.c b/src/sqlite.c index 7080928..f064280 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -11,6 +11,7 @@ #include +#include #include #include #include @@ -231,6 +232,19 @@ int sqlite_bind_text(sqlite3_stmt *stmt, int index, const char *value) return ret; } +int sqlite_bind_blob(sqlite3_stmt *stmt, int index, unsigned char *value, size_t nb) +{ + int ret = 0; + + ret = sqlite3_bind_blob64(stmt, index, value, nb, SQLITE_STATIC); + if (ret) { + sqlite_errno(ret, "sqlite3_bind_blob64"); + return ret; + } + + return ret; +} + int sqlite_exec_as_transaction(sqlite3 *db, const char *stmt) { static const char *const fmt = "BEGIN; %s COMMIT;"; -- cgit v1.2.3