D1Database
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7209
Methods
Section titled “Methods”batch()
Section titled “batch()”batch<
T
>(statements
):Promise
<D1Result
<T
>[]>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7211
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”statements
Section titled “statements”D1PreparedStatement
[]
Returns
Section titled “Returns”Promise
<D1Result
<T
>[]>
dump()
Section titled “dump()”dump():
Promise
<ArrayBuffer
>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7226
Returns
Section titled “Returns”Promise
<ArrayBuffer
>
exec()
Section titled “exec()”exec(
query
):Promise
<D1ExecResult
>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7212
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise
<D1ExecResult
>
prepare()
Section titled “prepare()”prepare(
query
):D1PreparedStatement
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7210
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”D1PreparedStatement
withSession()
Section titled “withSession()”withSession(
constraintOrBookmark?
):D1DatabaseSession
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250725.0/node_modules/@cloudflare/workers-types/index.ts:7220
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.
Parameters
Section titled “Parameters”constraintOrBookmark?
Section titled “constraintOrBookmark?”string
Either the session constraint or the explicit bookmark to anchor the created session.
Returns
Section titled “Returns”D1DatabaseSession