Cloudflare D1 (Edge SQLite)
Ultra-low latency edge relational database powered by Cloudflare D1.
Cloudflare D1 is a serverless, edge-native relational database co-located with Cloudflare Workers. Read queries execute with sub-5ms latency globally.
Highlights
- Low Latency: Queries execute on edge nodes near the user.
- Standard SQL: SQLite dialect supporting joins, indexes, transactions, and JSON operators.
- Drizzle ORM Integration: Schema definitions and typed queries out of the box.
TYPESCRIPT
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" }).notNull(),
});