Skip to content

D1Database

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8637

new D1Database(): D1Database

D1Database

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

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8639

T = unknown

D1PreparedStatement[]

Promise<D1Result<T>[]>


dump(): Promise<ArrayBuffer>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8654

Promise<ArrayBuffer>


exec(query): Promise<D1ExecResult>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8640

string

Promise<D1ExecResult>


prepare(query): D1PreparedStatement

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8638

string

D1PreparedStatement


withSession(constraintOrBookmark?): D1DatabaseSession

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:8648

Creates a new D1 Session anchored at the given constraint or the bookmark. All queries executed using the created session will have sequential consistency, meaning that all writes done through the session will be visible in subsequent reads.

string

Either the session constraint or the explicit bookmark to anchor the created session.

D1DatabaseSession