Skip to content

routier-collection


routier-collection / plugins/sqlite/src/d1 / D1Database

Interface: D1Database

Defined in: plugins/sqlite/src/d1.ts:64

The subset of Cloudflare's D1Database this plugin uses.

Methods

prepare()

prepare(sql): D1PreparedStatement

Defined in: plugins/sqlite/src/d1.ts:65

Parameters

sql

string

Returns

D1PreparedStatement


batch()

batch<T>(statements): Promise<object[]>

Defined in: plugins/sqlite/src/d1.ts:72

Runs every statement as ONE transaction: all of them apply, or none does.

A failure rejects and rolls the whole sequence back, which is the property this plugin depends on for a multi-statement save.

Type Parameters

T

T = unknown

Parameters

statements

D1PreparedStatement[]

Returns

Promise<object[]>

Released under the MIT License.