D1PreparedStatementinterface

{
	bind(...values: D1Value[]): D1PreparedStatement;
	first<T = Record<string, unknown>>(column?: string): Promise<T | null>;
	raw<T = unknown[]>(options?: { columnNames?: boolean }): Promise<readonly T[]>;
	run<T extends Record<string, unknown> = Record<string, unknown>>(): Promise<D1Result<T>>;
}

Minimal prepared statement interface for D1 databases and sessions.

Declares only the subset of the D1 prepared-statement API used by CloudflareD1Provider.

Methods

Go

D1PreparedStatement.bind()method

bind(...values: D1Value[]): D1PreparedStatement
Go

D1PreparedStatement.first()method

first(column?: string): Promise<T | null>
Go

D1PreparedStatement.raw()method

raw(options?: { columnNames?: boolean }): Promise<readonly T[]>
Go

D1PreparedStatement.run()method

run(): Promise<D1Result<T>>