Opens a SQLite database.
Supported options, all optional:
open (boolean, default true): open the database now. If false, call open() later.readOnly (boolean, default false): open the database read-only.enableForeignKeyConstraints (boolean, default true): enforce foreign key constraints.enableDoubleQuotedStringLiterals (boolean, default false): accept double-quoted string literals.timeout (integer, default 0): milliseconds to wait for a locked database before failing.readBigInts (boolean, default false): read INTEGER values as BigInts.returnArrays (boolean, default false): return rows as arrays instead of objects.allowBareNamedParameters (boolean, default true): allow named parameters without their prefix character.allowUnknownNamedParameters (boolean, default false): ignore named parameters that the statement doesn't use.Statements prepared on this database start with its readBigInts, returnArrays,
allowBareNamedParameters and allowUnknownNamedParameters settings.
The path of the database file, or ":memory:" for an in-memory database. A leading ~ is expanded to the home directory. Relative paths are relative to Hammerspoon's working directory, so use absolute paths.
Optionaloptions: Record<string, any>
The options described above
ReadonlyisWhether the database is currently open.
ReadonlyisWhether the database is inside a transaction. Throws if the database isn't open.
Closes the database, finalizing every statement prepared on it. Throws if the database isn't open.
Runs one or more SQL statements, without returning any results. Statements run in order until one fails, which throws.
The SQL to run
The file path of a database attached to this connection.
OptionaldbName: string
The name of the attached database. Defaults to "main".
The path, or null for an in-memory database or an unknown name
Opens the database. Only needed if it was constructed with open: false, or after
close(). Throws if the database is already open.
Compiles a SQL statement so it can be run, any number of times, with different parameters.
Only the first statement in sql is compiled.
The SQL to compile
The prepared statement
A connection to a SQLite database, as Node's
DatabaseSyncfromrequire('node:sqlite').Every method runs synchronously. Databases are opened with foreign key constraints enforced and double-quoted string literals disabled, as in Node.
Not implemented from Node:
function(),aggregate(),loadExtension(),enableLoadExtension(),createSession(),applyChangeset(),backup(),createTagStore()andSymbol.dispose.