DATABASE_URL connection string.
Database Drivers
SQLite (Default)
SQLite is the default database backend, perfect for development and small to medium deployments:- Zero configuration required
- WAL mode enabled for better concurrency
- Local file-based storage
- No separate database server needed
DATABASE_URL is specified.
PostgreSQL (Production Recommended)
PostgreSQL is recommended for production deployments:- Better scalability and performance
- ACID compliance with robust transaction support
- Multi-region support
- Better concurrent access handling
Connection String Formats
SQLite
PostgreSQL
Auto-Detection
TheDB_DRIVER variable is automatically detected from your connection string:
- Starts with
postgres://→ PostgreSQL driver - Starts with
file:or other → SQLite driver
Environment Variables
| Variable | Type | Default | Description |
|---|---|---|---|
DATABASE_URL | string | file:./pongo/pongo.db | Database connection string |
DB_DRIVER | sqlite | pg | auto-detected | Database driver (auto-detected from URL) |
Running Migrations
Migrations create and update your database schema. They run automatically during the build process, but you can also run them manually.PostgreSQL Migrations
DATABASE_URL for the first time, or when upgrading Pongo versions.
SQLite Migrations
Automatic Migrations
Migrations run automatically when you build for production:Database Studio
Pongo uses Drizzle ORM, which includes Drizzle Studio for visual database management.PostgreSQL Studio
SQLite Studio
Multi-Region Setup
When deploying multiple scheduler instances across regions, all schedulers should point to the same database:PostgreSQL is strongly recommended for multi-region deployments due to better concurrent access handling.
Docker Compose Example
Here’s a complete example with PostgreSQL:docker-compose.yml
Troubleshooting
Connection Issues
If you’re having trouble connecting to your database:- Verify your
DATABASE_URLis correct - Check that the database server is running
- Ensure network access (firewall rules, security groups)
- For PostgreSQL, verify SSL requirements match your connection string
Migration Failures
If migrations fail:- Check database permissions (CREATE TABLE, ALTER TABLE)
- Ensure the database exists (Pongo doesn’t auto-create databases)
- Review migration logs for specific errors
- For PostgreSQL, ensure your user has schema creation rights