Connecting
Every Flokk database is accessible via standard PostgreSQL connection strings over TLS. All connections go through PgBouncer in transaction mode.
Connection string format
postgresql://USER:PASSWORD@HOST:PORT/DATABASE?sslmode=require
Endpoints
| Type | Port | Routes to |
|---|---|---|
| Read-write | 5432 | Primary via PgBouncer (rw) |
| Read-only | 5433 | Replica via PgBouncer (ro) |
Both endpoints use the same hostname: {dbname}.db.flokk.dev. On failover, the primary switches automatically — your connection string stays the same.
SSL / TLS
TLS is required on all connections (hostssl in pg_hba, SCRAM-SHA-256 auth). Use sslmode=require or sslmode=verify-full. DANE/TLSA records are published for DNS-level certificate verification.
Go
import ( "database/sql" _ "github.com/jackc/pgx/v5/stdlib" ) db, err := sql.Open("pgx", "postgresql://flokk_mydb:PASS@mydb.db.flokk.dev:5432/mydb?sslmode=require")
Python
import psycopg conn = psycopg.connect( "postgresql://flokk_mydb:PASS@mydb.db.flokk.dev:5432/mydb?sslmode=require" )
Node.js
import pg from 'pg'; const pool = new pg.Pool({ connectionString: 'postgresql://flokk_mydb:PASS@mydb.db.flokk.dev:5432/mydb?sslmode=require', });
psql
psql "postgresql://flokk_mydb:PASS@mydb.db.flokk.dev:5432/mydb?sslmode=require"
Connection pooling
PgBouncer runs in transaction mode between your app and PostgreSQL. Your app can open thousands of client connections; PgBouncer multiplexes them onto ~20 server-side connections. Per-tenant connection limits are enforced by the plan (Starter: 5, Pro: 25).
Because of transaction mode, session-level features like SET statements, prepared statements, and advisory locks do not persist across transactions. Use SET LOCAL instead, or set parameters on the role with ALTER ROLE.