interface ID1PreparedStatement
Since 0.2.0

A prepared D1 statement.

Methods

bind(...values: readonly unknown[]): ID1PreparedStatement

Binds ordered parameters. D1 supports ? and ?NNN, not named parameters.

all<T = Record<string, unknown>>(): Promise<D1Result<T>>

Runs the statement and returns every row.

first<T = Record<string, unknown>>(): Promise<T | null>

Runs the statement and returns the first row.

run<T = Record<string, unknown>>(): Promise<D1Result<T>>

Runs the statement for its effect.

Usage

import { type ID1PreparedStatement } from "cloudflare-plugin/src/index.ts";