cleanup, docs

This commit is contained in:
root
2026-06-16 23:02:45 +00:00
parent ea08d5f28b
commit b8b56cf3dd
160 changed files with 1076 additions and 511 deletions
+10 -1
View File
@@ -37,4 +37,13 @@ Result rows are objects keyed by column name. SQLite integer, float, text, blob,
For statements that do not return rows, inspect `sqlite_affected_rows()` or `sqlite_insert_id()` after the call.
:example
print("sqlite_query is resource-bound; configure the service or connection, then call it in request code.\n");
SQLite* db = sqlite_connect("/tmp/doc-sqlite-query.db");
sqlite_query(db, "drop table if exists users");
sqlite_query(db, "create table users(id integer primary key, email text)");
StringMap params; params["email"] = "ada@example.test";
sqlite_query(db, "insert into users(email) values(:email)", params);
DValue rows = sqlite_query(db, "select email from users");
String first = "none";
rows.each([&](DValue row, String key) { first = row["email"].to_string(); });
print(first, "\n");
sqlite_disconnect(db);