Skip to content

D1Database

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7220

new D1Database(): D1Database

D1Database

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

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7222

T = unknown

D1PreparedStatement[]

Promise<D1Result<T>[]>


dump(): Promise<ArrayBuffer>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7237

Promise<ArrayBuffer>


exec(query): Promise<D1ExecResult>

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7223

string

Promise<D1ExecResult>


prepare(query): D1PreparedStatement

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7221

string

D1PreparedStatement


withSession(constraintOrBookmark?): D1DatabaseSession

Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7231

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