Database
Database Overview
How Creator connects to PostgreSQL and manages data with Drizzle ORM.
Creator uses Drizzle ORM with PostgreSQL as its data access layer. Drizzle provides type-safe queries, schema definitions, and migration tooling.
Database client
The client is initialized in lib/db/index.ts using postgres.js with prepare: false for compatibility with connection poolers like Supabase and Neon.
DATABASE_URL="postgresql://user:password@host:5432/dbname" # Use transaction pooler URLUse the transaction pooler connection string from your database provider, not the direct connection URL.
File organization
lib/db/
├── index.ts → Database client
├── schema.ts → Table definitions
├── seed.ts → Admin user seeder
└── queries/ → Pre-built query modules