Runs a query and returns every row.
The Worker environment.
SQL statement, using ? placeholders for bind values.
Values bound to the placeholders, in order.
The matched rows, empty when the query matched nothing.
Runs several statements as one batch.
The batch shares an implicit transaction, so a failure part-way through rolls the whole set back.
The Worker environment.
Statements and their bind values, in execution order.
One result per statement, in the order supplied.
Runs a query and returns its first row.
The Worker environment.
SQL statement, using ? placeholders for bind values.
Values bound to the placeholders, in order.
The first matched row, or null when the query matched nothing.
Reports whether the database is bound to this Worker.
The Worker environment.
true when the binding is present.
Runs a write and reports what it changed.
The Worker environment.
SQL statement, using ? placeholders for bind values.
Values bound to the placeholders, in order.
The row count and the id assigned by an insert.
D1 capability.
The relational-storage half of the core: queries, writes, and batches expressed in SQL, with the binding and its configuration kept out of sight.
Remarks
Callers pass values separately from the statement, so user input is always parameterised. Nothing here knows what the rows mean — the schema belongs to whichever business service owns it.
Author
Bayu Dwiyan Satria
Version
1.0.0
Since
1.0.0