It's just PostgreSQL and Drizzle ORM. Type-safe and ready for production, no BS.
Starter comes with PostgreSQL and Drizzle ORM already set up. Add your DATABASE_URL and start working.
.env:DATABASE_URL=postgres://user:password@host:port/dbnamebun run db:pushDone. DB is live.
Schemas are organized by feature under src/features/*/. Everything gets exported through the main file: src/features/database/schema.ts.
Examples:
src/features/auth/auth.schema.tssrc/features/yourfeature/yourfeature.schema.tsThe db instance is available from src/features/database/db.ts. Import it for server-side use:
// Example query
const allRoles = await db.select().from(roles);| Task | Command |
|---|---|
| Push schema changes to the database | bun run db:push |
| Generate new migration files | bun run db:generate |
| Add a new table | Create the file, then run bun run db:push |
src/features/yourfeature/yourfeature.schema.tspgTable().src/features/database/schema.ts.bun run db:push.That's all you need.
Required:
DATABASE_URL - Gotta have your PostgreSQL connection string here.Deployment Tip: Use a managed DB service—Railway, Supabase, Neon, whatever. They give you the secure connection strings you need.
.env to version control. Ever.db:generate) for schema changes. db:push is for dev/testing.