Optional
parameters: ParametersPrivate
Readonly
configPrivate
Optional
Readonly
parametersPrivate
Readonly
sqlPrivate
#parsePrivate
#waitExecutes a query and returns all rows and metadata.
Optional
colName: undefinedIf provided, filter results to the provided column.
Optional
opts: SignalAndIntervalAdditional options to control execution.
Optional
opts: SignalAndIntervalBind a set of values to the parameters of the prepared statement. We follow the SQLite convention for prepared statements parameter binding. We support Ordered (?NNNN), Anonymous (?), and Named (@name, :name, $name) parameters.
Rest
...values: ValuesType[]A variadic list of values to bind. May include base types, and objects.
A new bound Statement.
Executes a query and returns the first row of the results. This does not return metadata like the other methods. Instead it returns the object directly. If the query returns no rows, then first() will return null.
Optional
opts: SignalAndIntervalOptional
opts: SignalAndIntervalSame as stmt.all(), but returns an array of rows instead of objects.
Additional options to control execution.
An array of raw query results.
Runs the query/queries, but returns no results. Instead, run() returns the metrics only. Useful for write operations like UPDATE, DELETE or INSERT.
Additional options to control execution.
A results object with metadata only (results are null or an empty array).
Export a Statement's sql string and parameters.
Optional
parameters?: ParametersGenerated using TypeDoc
Statement defines a single SQL statement. Both static and prepared statements are supported. In the current implementation, the prepared statements are prepared locally, and executed remotely (on-chain). Mutating transactions such as INSERTs, DELETEs, and UPDATEs produce a two-phase transaction. Firstly, the transaction is sent to the registry contract, and awaited. The returned
txn
information also contains await
method than can be used to await finalization on the Tableland network. This method will also throw an exception if any runtime errors occur.