From 941cf8f1f3b5c440ceaa8cac363e9aae2ffea545 Mon Sep 17 00:00:00 2001 From: SpookyDervish Date: Tue, 20 Jan 2026 19:41:34 +1100 Subject: [PATCH] removed sqlite3, too complicated and not needed for now --- sqlite3/sqlite3.c | 50 ----------------------------------------------- test.db | 0 2 files changed, 50 deletions(-) delete mode 100644 sqlite3/sqlite3.c delete mode 100644 test.db diff --git a/sqlite3/sqlite3.c b/sqlite3/sqlite3.c deleted file mode 100644 index 71d8f3c..0000000 --- a/sqlite3/sqlite3.c +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include -#include -#include - -sqlite3* getDB(List args) { - return (sqlite3*)args.values[0].data.intVal; -} - -GroundValue exec_sql(GroundScope* scope, List args) { - printf("hi\n"); - sqlite3* DB = getDB(args); - printf("got db\n"); - char* sqlCode = args.values[1].data.stringVal; - printf("%s\n", sqlCode); - - char* errMessage; - int exitCode = sqlite3_exec(DB, sqlCode, NULL, 0, &errMessage); - - if (exitCode != SQLITE_OK) { - ERROR(errMessage, "SQLite3Error"); - } else { - return groundCreateValue(INT, 0); - } -} - -GroundValue close_db(GroundScope* scope, List args) { - sqlite3* DB = getDB(args); - sqlite3_close(DB); - return groundCreateValue(INT, 0); -} - -GroundValue open_db(GroundScope* scope, List args) { - sqlite3* DB; - - const char* dbPath = args.values[0].data.stringVal; - int errorCode = sqlite3_open(dbPath, &DB); - - if (errorCode) { - ERROR(sqlite3_errmsg(DB), "SQLite3Error"); - } - - return groundCreateValue(INT, (uint64_t)DB); -} - -void ground_init(GroundScope* scope) { - groundAddNativeFunction(scope, "sqlite3_Open", open_db, INT, 1, STRING, "dbPath"); - groundAddNativeFunction(scope, "sqlite3_Close", close_db, INT, 1, INT, "db"); - groundAddNativeFunction(scope, "sqlite3_Exec", exec_sql, INT, 2, INT, "db", STRING, "sql"); -} \ No newline at end of file diff --git a/test.db b/test.db deleted file mode 100644 index e69de29..0000000