Opens a SQLite database.
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: {How to open the database
OptionalallowBareNamedParameters?: booleanAllow named parameters without their prefix character. Defaults to true
OptionalallowUnknownNamedParameters?: booleanIgnore named parameters that the statement doesn't use. Defaults to false
OptionalenableDoubleQuotedStringLiterals?: booleanAccept double-quoted string literals. Defaults to false
OptionalenableForeignKeyConstraints?: booleanEnforce foreign key constraints. Defaults to true
Optionalopen?: booleanOpen the database now. If false, call open() later. Defaults to true
OptionalreadBigInts?: booleanRead INTEGER values as BigInts. Defaults to false
OptionalreadOnly?: booleanOpen the database read-only. Defaults to false
OptionalreturnArrays?: booleanReturn rows as arrays instead of objects. Defaults to false
Optionaltimeout?: numberMilliseconds to wait for a locked database before failing. Defaults to 0
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.