D1Database
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7220
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new D1Database():
D1Database
Returns
Section titled “Returns”D1Database
Methods
Section titled “Methods”batch()
Section titled “batch()”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
Type Parameters
Section titled “Type Parameters”T
= unknown
Parameters
Section titled “Parameters”statements
Section titled “statements”Returns
Section titled “Returns”Promise
<D1Result
<T
>[]>
dump()
Section titled “dump()”dump():
Promise
<ArrayBuffer
>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7237
Returns
Section titled “Returns”Promise
<ArrayBuffer
>
exec()
Section titled “exec()”exec(
query
):Promise
<D1ExecResult
>
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7223
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.20250823.0/node_modules/@cloudflare/workers-types/index.ts:7221
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”withSession()
Section titled “withSession()”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.
Parameters
Section titled “Parameters”constraintOrBookmark?
Section titled “constraintOrBookmark?”string
Either the session constraint or the explicit bookmark to anchor the created session.