Atom

sqlite module

Open a SQLite database, run SQL, and manage transactions.

Import it with 'use sqlite'.

Atom
use sqlite
db = sqlite.open()
try:
    print(sqlite.query(db, 'SELECT 42 AS value')[0].value)
finally:
    sqlite.close(db)
Output
42

Requires ATOM_WITH_SQLITE. A database handle belongs to one VM. Use open then exec, query or transaction, and close when finished. A file-backed database needs filesystem permission. Without it, ATTACH and DETACH are denied even for an in-memory database. SQLite defensive mode is enabled and trusted schema is disabled. Use one SQL statement per call. Bound parameters allow null, booleans (as integer 0/1), signed integers, unsigned integers up to i64 max, floats, char/string as UTF-8 text, or packed data as a copied BLOB.

Functions