cloudflare · Cloudflare Workers Docs
Workers Connect to databases
Overview of methods for connecting Cloudflare Workers to various database types including D1, traditional SQL databases via Hyperdrive, and third-party serverless databases.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Workers Connect to databases
Overview of methods for connecting Cloudflare Workers to various database types including D1, traditional SQL databases via Hyperdrive, and third-party serverless databases.
When To Use
Use when you need to determine the optimal connection method or driver for integrating a specific SQL or NoSQL database with a Cloudflare Worker.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-databases-connecting-to-connect-workflow-guide.md | A guide explaining how Cloudflare Workers connect to D1, traditional SQL databases via Hyperdrive, and other serverless databases. | Questions about a guide explaining how Cloudflare Workers connect to D1, traditional SQL databases via Hyperdrive, and other serverle... |
examples/workers-databases-connecting-to-connect-cloudflare-workers-database-conn.text | A text command demonstrating how to use the Wrangler CLI to securely store database credentials as secrets in a Cloudflare Workers environment. | Exact payloads, commands, or snippets shown in A text command demonstrating how to use the Wrangler CLI to securely store database credentials as secrets in a Cloud... |
examples/workers-databases-connecting-to-connect-cloudflare-workers-database-conn-2.text | A text snippet demonstrating how to access database credentials using environment variables within a Cloudflare Worker. | Exact payloads, commands, or snippets shown in A text snippet demonstrating how to access database credentials using environment variables within a Cloudflare Worker. |
What This Skill Covers
- Cloudflare Workers can connect to and query your data in both SQL and NoSQL databases, including:
- Main sections:
D1 SQL database,Traditional SQL databases,Serverless databases,Authentication,Next steps.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.cloudflare.com/workers/databases/connecting-to-databases
