Skip to content

SQL

See Databases to compare engines and connection paths, with links directly to each database’s setup guide.

Client Guides
Effect SQL Postgres · MySQL · D1 · Durable Objects
Drizzle Postgres · MySQL · D1 · Durable Objects
Prisma ORM v8 Contracts · Postgres · Migrations

Prisma ORM v8 requires PostgreSQL 17+ and is separate from the Prisma hosting provider.

Integration Guide
Lambda + Aurora PostgreSQL + Drizzle AWS
Lambda + Aurora DSQL + Drizzle AWS
Workers + Neon or PlanetScale + Drizzle Cloudflare
Workers + D1 + Drizzle Cloudflare
Durable Objects + SQLite Cloudflare
Fly Service + Postgres + Drizzle Fly
Hetzner Service + external Postgres + Drizzle Hetzner
Prisma Compute + Postgres + Drizzle Prisma
Railway Service + Postgres + Drizzle Railway
Railway Service + MySQL + Drizzle Railway
Workers + Neon + Prisma ORM Cloudflare

See runnable examples for complete projects.

import * as SQL from "alchemy/SQL/Postgres";
import * as Config from "effect/Config";
import * as Effect from "effect/Effect";
const query = Effect.gen(function* () {
const sql = yield* SQL.Postgres({ url: Config.Redacted("DATABASE_URL") });
return yield* sql`SELECT 1 AS value`;
});

Run queries within the application’s execution scope, or use Effect.scoped in a standalone program; see connection lifecycle.

Generate migrations when schemas change, stage and review the schema, SQL, and snapshots with git diff --cached, then commit them before deployment. Apply the committed files using the selected database’s workflow.

SQL files · Drizzle migrations · Prisma migrations