D1SqlDatabase class final
A typed SQL database backed by a Cloudflare D1 Worker binding.
The binding remains owned by the Worker runtime. Closing this adapter only prevents this instance from starting more operations.
- Implemented types
Constructors
- D1SqlDatabase.fromBinding(JSObject binding)
- Wraps one D1 database binding from a Worker's environment.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
atomicWrite(
List< BoundSql> statements) → Future<List< SqlWriteResult> > -
Executes transaction-safe DML
statementsas one atomic write batch.override -
close(
) → Future< void> -
Releases resources owned by this database.
override
-
execute(
BoundSql statement) → Future< SqlWriteResult> -
Executes a D1 write and rejects results that contain returned rows.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query<
T> (BoundSql statement, T decode(SqlRow row)) → Future< List< T> > -
Executes an explicitly row-returning D1 statement.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited