> ## Documentation Index
> Fetch the complete documentation index at: https://012e27a-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://012e27a-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://012e27a-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://012e27a-docs-2.manicule.dev/.well-known/llms-manifest.json

# Cloudflare D1 (Edge SQLite) (/databases/cloudflare-d1)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 261 · updated: 2026-11-12 -->
Related: [Managed Databases & Storage](/databases/overview.md), [Neon Serverless Postgres](/databases/neon-postgres.md), [Supabase Managed Postgres](/databases/supabase-postgres.md), [Database Migrations & ORM Setup](/databases/migrations.md)

> Ultra-low-latency edge SQLite that runs alongside Cloudflare Workers.

**Cloudflare D1** is a serverless, edge-native relational database co-located with Cloudflare
Workers. Reads are served close to the user, typically with sub-5 ms latency.

## Highlights

* **Low latency**: queries execute on edge nodes near the reader.
* **Standard SQL**: SQLite dialect with joins, indexes, transactions, and JSON operators.
* **Drizzle integration**: typed schema and queries out of the box.

```ts title="db/schema.ts"
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";

export const products = sqliteTable("products", {
  id: text("id").primaryKey(),
  name: text("name").notNull(),
  priceInCents: integer("price_in_cents").notNull(),
  createdAt: integer("created_at", { mode: "timestamp" })
    .$defaultFn(() => new Date())
    .notNull(),
});
```

## Provision it

Open the **Databases** drawer in Cloud Studio and select **Cloudflare D1**, or connect the
provider first. BhaiCode binds the D1 binding and installs Drizzle.
