summaryrefslogtreecommitdiff
path: root/anim/tools/sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'anim/tools/sqlite.c')
-rw-r--r--anim/tools/sqlite.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/anim/tools/sqlite.c b/anim/tools/sqlite.c
new file mode 100644
index 0000000..5d018c6
--- /dev/null
+++ b/anim/tools/sqlite.c
@@ -0,0 +1,18 @@
+// Three rows into a table of a file database, in one transaction: SQLite's
+// amalgamation (not ours: build.zig takes it from -Dsqlite) as a library.
+#include "sqlite3.h"
+
+int main(void) {
+ sqlite3 *db;
+ if (sqlite3_open("t.db", &db) != SQLITE_OK) return 1;
+ int rc = sqlite3_exec(db,
+ "CREATE TABLE t(word TEXT);"
+ "BEGIN;"
+ "INSERT INTO t VALUES ('alpha');"
+ "INSERT INTO t VALUES ('beta');"
+ "INSERT INTO t VALUES ('gamma');"
+ "COMMIT;",
+ 0, 0, 0);
+ sqlite3_close(db);
+ return rc;
+}