TinyShip
TinyShip
 TinyShip
TinyShip
TinyShip Documentation
TinyShip User GuideGetting StartedBasic Configuration
Credits System ConfigurationAffiliate System Configuration
Storage Service ConfigurationDatabase ConfigurationCaptcha Configuration
Development Best PracticesLocal E2E Workflow
User Guide

Database Configuration

Multi-dialect setup for PostgreSQL / SQLite / Cloudflare D1

TinyShip supports multi-dialect database setup, switched by DB_DIALECT without changing business logic.

Supported Dialects

DialectDB_DIALECTNotes
PostgreSQLpg (default)Recommended and most fully validated
SQLitesqliteLocal file database for local dev
Cloudflare D1d1Managed SQLite on Workers

Quick Switch

# PostgreSQL (default)
DB_DIALECT="pg"
DATABASE_URL="postgresql://username:password@localhost:5432/tinyship"

# SQLite
DB_DIALECT="sqlite"
# SQLITE_DB_PATH="./data/local.sqlite"

# D1 (Workers)
DB_DIALECT="d1"

Common Commands

ActionPostgreSQLSQLite
Check connectionpnpm db:checkpnpm db:check:sqlite
Push schemapnpm db:pushpnpm db:push:sqlite
Seed datapnpm db:seedpnpm db:seed:sqlite
Open studiopnpm db:studiopnpm db:studio:sqlite

D1 Notes

  • D1 and SQLite share the same schema set
  • D1 migrations use Wrangler CLI: wrangler d1 migrations apply
  • D1 is only for Cloudflare Workers deployment path

If Next/Nuxt/TanStack should share one database, prefer PostgreSQL (pg).

Storage Service Configuration

Configure file storage providers

Captcha Configuration

Configure human verification functionality

On this page

Supported DialectsQuick SwitchCommon CommandsD1 Notes