Prompt Buddy logoPrompt Buddy

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.

Import to Prompt Buddy

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

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-databases-connecting-to-connect-workflow-guide.mdA 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.textA 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.textA 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

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. 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