SQL
Choose a database
Section titled “Choose a database”See Databases to compare engines and connection paths, with links directly to each database’s setup guide.
Choose a client
Section titled “Choose a client”| 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.
Find an integration
Section titled “Find an integration”| 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.
Already have a database?
Section titled “Already have a database?”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.
Manage schema changes
Section titled “Manage schema changes”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.