Skip to main content

Cloudflare/d1

@swamp/cloudflare/d1v2026.10.23.1· AGPL-3.0-or-later· 3d agoBEHAVIORS
01README

Cloudflare d1 infrastructure models

02Release Notes
  • Updated: database
03Behaviors1
@swamp/cloudflare/d1/databasev2026.10.23.1database.ts

Global Arguments

ArgumentTypeDescription
account_idstringCloudflare account ID
read_replication?objectConfiguration for D1 read replication.
jurisdiction?enumSpecify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.
name?stringD1 database name.
primary_location_hint?enumSpecify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.
apiToken?stringCloudflare API token; overrides the CLOUDFLARE_API_TOKEN environment variable. Wire with a vault.get(...) expression to source it from a vault.
apiKey?stringCloudflare API key for the legacy key+email auth path; overrides the CLOUDFLARE_API_KEY environment variable. Wire with a vault.get(...) expression. Requires email.
email?stringCloudflare account email for the legacy key+email auth path; overrides the CLOUDFLARE_EMAIL environment variable. Requires apiKey.
fn create()
Create a Database
fn get(id: string)
Get a Database
ArgumentTypeDescription
idstringThe ID of the Database
fn lookup(allowMissing?: boolean)
Look up an existing Database by matching global argument values and import it into state
ArgumentTypeDescription
allowMissing?booleanSucceed and record found: false in lookupResult when nothing matches, instead of failing
fn adopt(id: string)
Import an existing Database by ID into state for management
ArgumentTypeDescription
idstringThe ID of the Database to import
fn update(identifier?: string)
Update Database attributes
ArgumentTypeDescription
identifier?stringTarget a specific Database by id (e.g. one discovered by list)
fn delete(id: string)
Delete the Database
ArgumentTypeDescription
idstringThe ID of the Database
fn sync(identifier?: string)
Sync Database state from Cloudflare
ArgumentTypeDescription
identifier?stringTarget a specific Database by id (e.g. one discovered by list)

Resources

state(infinite)— Database resource state
lookupResult(infinite)— Outcome of the most recent lookup
04Previous Versions12
2026.10.20.1AGPL-3.0-or-later
  • Updated: database

Modified 1 behaviors

2026.10.16.1AGPL-3.0-or-later(was none)
2026.10.13.1
  • Updated: database
2026.09.29.1
  • Updated: database
2026.08.25.2
  • Updated: database
2026.08.25.1
  • Updated: database
2026.08.11.1
  • Updated: database
2026.07.21.1
  • Updated: database
2026.07.18.2

Modified 1 behaviors

2026.06.08.2
  • Updated: database
2026.05.29.1
  • Updated: database
2026.05.22.1
  • Added: database
05Stats
A
100 / 100
Downloads
27
Archive size
12.1 KB
Verified by Swamp
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Docs keep secrets in a vault1/1earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned
06Platforms
07Labels