Database Integration
Supported Databases
- PostgreSQL
- MySQL
- MongoDB
- Snowflake
- BigQuery
Adding a Connection
Via UI
- Go to Settings > Database Connections
- Click "Add Connection"
- Select database type
- Enter connection details
- Test connection
- Save
Via API
POST /api/database/connections
Authorization: Bearer <token>
{
"name": "Production PostgreSQL",
"type": "postgresql",
"uri": "postgresql://user:password@host:5432/db",
"use_for": ["source", "destination"]
}
Using in Pipelines
Source Node
{
"id": "db-source",
"type": "database",
"data": {
"connection_id": "uuid-of-connection",
"query": "SELECT * FROM orders WHERE date > '2024-01-01'"
}
}
Destination Node
{
"id": "db-dest",
"type": "database",
"data": {
"connection_id": "uuid-of-connection",
"table": "orders_staging",
"mode": "append"
}
}
Connection Modes
| Mode | Description |
|---|---|
append | Add new rows to existing table |
replace | Drop and recreate table |
upsert | Insert or update on conflict |
Best Practices
- Use connection pooling for high-volume pipelines
- Store credentials securely - use Supabase secrets
- Test connections before saving
- Use read replicas for source queries
- Configure timeouts appropriate for query complexity