Skip to main content

Module d1

Module d1 

Source
Expand description

Cloudflare D1 database backend

Supports two table schemas:

  • Real columns (recommended): standard SQL tables with typed columns
  • JSON blob (legacy): tables with id INTEGER PRIMARY KEY, data TEXT

Auto-detects which mode to use per table. System tables:

  • _kv_store(key TEXT PRIMARY KEY, value TEXT) — key-value pairs
  • _collections(name TEXT PRIMARY KEY) — collection registry

All operations go through the D1 HTTP REST API.

Structs§

D1Database
Cloudflare D1 database client