Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers D1

Configures and interacts with D1 SQL databases within a Miniflare testing environment using the getD1Database method.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers D1

Configures and interacts with D1 SQL databases within a Miniflare testing environment using the getD1Database method.

When To Use

Use when you need to bind and access D1 database instances within a local Miniflare testing environment to simulate real-world Worker storage interactions.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-testing-miniflare-d1-workflow-guide.mdA guide on specifying and interacting with D1 databases within a Miniflare testing environment for Cloudflare Workers.Questions about a guide on specifying and interacting with D1 databases within a Miniflare testing environment for Cloudflare Workers.
examples/workers-testing-miniflare-d1-cloudflare-workers-miniflare-d1-configurati.textA Miniflare configuration object demonstrating how to initialize a D1 database instance for local testing.Exact payloads, commands, or snippets shown in A Miniflare configuration object demonstrating how to initialize a D1 database instance for local testing.
examples/workers-testing-miniflare-d1-cloudflare-workers-miniflare-d1-database-us.textA JavaScript code snippet demonstrating how to access and execute queries on a D1 database instance using Miniflare.Exact payloads, commands, or snippets shown in A JavaScript code snippet demonstrating how to access and execute queries on a D1 database instance using Miniflare.

What This Skill Covers

  • Specify D1 Databases to add to your environment as follows:
  • Main sections: Databases, Working with D1 Databases.

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/testing/miniflare/storage/d1/index.md