Database
Supabase
Connect Supabase PostgreSQL.
Overview
Supabase is a Postgres-based backend platform. shipkit can use its Postgres connection directly.
Quick start
1) Create a project
- Sign up on Supabase.
- Create a project in the Supabase dashboard.
- Generate and copy the database password.
2) Get the database URL
- Open your project and click Connect.
- Switch to ORMs → Drizzle.
- Copy the
DATABASE_URLand replace[YOUR-PASSWORD].
Example:
postgresql://postgres.xxxxxx:your_password@aws-1-ap-northeast-1.pooler.supabase.com:6543/postgres3) Test the connection (optional)
If you have psql installed:
psql "postgresql://postgres.xxxxxx:your_password@aws-1-ap-northeast-1.pooler.supabase.com:6543/postgres"4) Configure environment variables
DATABASE_URL=your_supabase_database_url
DB_PROVIDER=supabase5) Apply schema
pnpm db:pushOr use migrations:
pnpm db:generate
pnpm db:migrate6) Manage data
Use the Supabase dashboard or run locally:
pnpm db:studioCustomize
Modify schema
Schema lives in src/lib/db/schema.ts. After changes, run migrations again.
Adjust connection logic
Connection logic is in src/lib/db/index.ts. Update it if you need custom pool settings.