// 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; }