Skip to content

SqliteStatement

Defined in: libs/runtime/src/sqlite-database.ts:38

A prepared statement. The overloads mirror node:sqlite’s: positional parameters, or one named-parameter object (optionally followed by positional ones).

Methods

Name Description
all() Every row, as plain objects keyed by column name.
get() The first row, or undefined when there is none.
run() Runs the statement and reports how many rows it changed.

all(…parameters): SqliteRow[]

Defined in: libs/runtime/src/sqlite-database.ts:43

Every row, as plain objects keyed by column name.

…SqliteParameter[]

SqliteRow[]

all(named, …parameters): SqliteRow[]

Defined in: libs/runtime/src/sqlite-database.ts:44

SqliteNamedParameters

…SqliteParameter[]

SqliteRow[]


get(…parameters): SqliteRow | undefined

Defined in: libs/runtime/src/sqlite-database.ts:40

The first row, or undefined when there is none.

…SqliteParameter[]

SqliteRow | undefined

get(named, …parameters): SqliteRow | undefined

Defined in: libs/runtime/src/sqlite-database.ts:41

SqliteNamedParameters

…SqliteParameter[]

SqliteRow | undefined


run(…parameters): SqliteRunResult

Defined in: libs/runtime/src/sqlite-database.ts:51

Runs the statement and reports how many rows it changed. changes is read, so it must be exact: the change log runs an INSERT OR IGNORE and treats changes > 0 as “this revision was new”, which is how replication knows whether a row was applied. A binding that cannot report it per statement must read it straight after the statement. lastInsertRowid is read nowhere, so do not rely on it.

…SqliteParameter[]

SqliteRunResult

run(named, …parameters): SqliteRunResult

Defined in: libs/runtime/src/sqlite-database.ts:52

SqliteNamedParameters

…SqliteParameter[]

SqliteRunResult

TypeDBLite is an independent open-source project, built on TypeDB with thanks. It is not affiliated with, sponsored by, or endorsed by TypeDB Ltd. Released under the MPL-2.0 license.