ShipAny Docs

Database

Supported Providers

ShipAny TanStack uses Drizzle ORM. Set DATABASE_PROVIDER + DATABASE_URL:

ProviderDATABASE_URL exampleNotes
sqlitefile:data/local.dbDefault — zero setup for local dev
postgrespostgresql://user:pass@localhost:5432/dbnameOptional DB_SCHEMA
mysqlmysql://user:pass@localhost:3306/dbnameMySQL 5.7+
tursolibsql://your-db.turso.ioPlus DATABASE_AUTH_TOKEN
d1(D1 binding, no URL)Cloudflare Workers deploys

Switching Providers

# 1. Edit .env.development: DATABASE_PROVIDER + DATABASE_URL
# 2. Copy the matching schema template (.sqlite/.postgres/.mysql) to schema.ts
pnpm db:setup
# 3. Apply the schema
pnpm db:push

The schema lives at src/config/db/schema.ts, generated from dialect-specific templates (schema.sqlite.ts, schema.postgres.ts, schema.mysql.ts).

Migration Workflow

  • Developmentpnpm db:push applies schema changes directly, no SQL files.
  • Production — generate versioned migrations and run them:
pnpm db:generate   # writes .sql migration files into ./drizzle
pnpm db:migrate    # runs pending migrations
  • Browse datapnpm db:studio opens Drizzle Studio.

Tables

GroupTables
Authuser, session, account, verification
Contentconfig, taxonomy (categories), post
Businessorder, subscription, credit, apiKey, inviteCode, userRole, role, permission, rolePermission