Cloudflare D1: serverless SQL in Workers
Answer: D1 is Cloudflare's native serverless SQL database. The get-started guide covers creating a first database, defining a schema, and connecting a Cloudflare Worker to the database with a binding so you can query it from the Worker.
Examples
npx wrangler d1 create my-database
Rules
- You can follow the same steps in the CLI or in the dashboard.
- Bind the database to the Worker before you query it in code.
See also
Claims
- id: C1 claim: The guide connects a Worker to a D1 database. source: S1 evidence: "Connecting a Cloudflare Worker to your D1 database"
- id: C2 claim: D1 is Cloudflare's native serverless SQL database. source: S2 evidence: "Cloudflare's native serverless SQL database"
- id: C3 claim: The guide starts by creating your first D1 database. source: S2 evidence: "Creating your first database"
Sources
- [S1] D1 get started. Cloudflare docs. https://developers.cloudflare.com/d1/get-started/ . License: CC-BY-4.0. Accessed 2026-11-18.
- [S2] D1 get started (source). Cloudflare docs source. https://raw.githubusercontent.com/cloudflare/cloudflare-docs/production/src/content/docs/d1/get-started.mdx . License: CC-BY-4.0. Accessed 2026-11-18.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Cloudflare docs, D1 get started; Cloudflare docs source, D1 get started (source). CC-BY-4.0 (https://raw.githubusercontent.com/cloudflare/cloudflare-docs/production/LICENSE). Copyright Cloudflare, Inc. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Cloudflare docs, D1 get started; Cloudflare docs source, D1 get started (source). CC-BY-4.0 (https://raw.githubusercontent.com/cloudflare/cloudflare-docs/production/LICENSE). Copyright Cloudflare, Inc.
Cite this
iinventedlight. 2026. "Cloudflare D1: serverless SQL in Workers." iinventedlight Library, iil:note:kqnv64pm, version of 2026-11-18. https://iinventedlight.com/library/notes/cloudflare-d1/. License: CC-BY-4.0.
@misc{iil_note_kqnv64pm,
author = {{iinventedlight}},
title = {{Cloudflare D1: serverless SQL in Workers}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-18},
url = {https://iinventedlight.com/library/notes/cloudflare-d1/},
note = {Permanent ID iil:note:kqnv64pm. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/cloudflare-d1.md.