CloudflareD1Providerclass

new CloudflareD1Provider<I, T>(db: D1Database)
ParamType
dbD1Database
Minimal D1 binding/session interface used by CloudflareD1Provider. required
Return
CloudflareD1Provider<I, T>
SQLite database provider backed by Cloudflare D1.

SQLite database provider backed by Cloudflare D1.

Implements the SQLiteProvider SQL abstraction by binding tagged-template queries and running them through the D1 Worker API.

  • Tagged-template values are flattened into positional ? bindings; nested SQLFragment values are inlined recursively.
  • Array and plain-object values are JSON-encoded before binding; other non-primitive values throw ValueError.
  • The D1Database binding is provided by the Cloudflare Workers runtime environment.