feat: add cJSON and SQLite amalgamation source files under deps/

Add the cJSON library (cJSON.c, cJSON.h) and SQLite amalgamation
(sqlite3.c, sqlite3.h, sqlite3ext.h, shell.c) as vendored dependencies
in the deps/ directory for use by the project build system.
This commit is contained in:
2026-01-24 18:35:43 +00:00
parent 8f1d13a86b
commit fdd61cc90c
118 changed files with 315687 additions and 6 deletions
+27
View File
@@ -0,0 +1,27 @@
// retoor <retoor@molodetz.nl>
import "sqlite" for Database
var db = Database.memory()
System.print(db is Database) // expect: true
db.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)")
db.execute("INSERT INTO users (name, age) VALUES (?, ?)", ["Alice", 30])
System.print(db.lastInsertId) // expect: 1
System.print(db.changes) // expect: 1
db.execute("INSERT INTO users (name, age) VALUES (?, ?)", ["Bob", 25])
System.print(db.lastInsertId) // expect: 2
var rows = db.query("SELECT * FROM users ORDER BY id")
System.print(rows.count) // expect: 2
System.print(rows[0]["name"]) // expect: Alice
System.print(rows[0]["age"]) // expect: 30
System.print(rows[1]["name"]) // expect: Bob
var filtered = db.query("SELECT * FROM users WHERE age > ?", [26])
System.print(filtered.count) // expect: 1
System.print(filtered[0]["name"]) // expect: Alice
db.close()