Clients and Drivers
ScramDB speaks the PostgreSQL wire protocol, so the drivers and tools you already use work without changes. Point them at ScramDB the way you would point them at PostgreSQL, with a host, port, database, user, and password. There is no ScramDB-specific SDK to install and no new query language to learn.
The examples below assume ScramDB is listening on localhost:5432 with a database named scramdb.
The published scramdb/scramdb Docker image starts with authentication disabled by default: any client that reaches port 5432 can connect as any user with no password. That's fine for a local instance on your own machine, but do not point a shared or internet-reachable ScramDB instance's driver connections at it without first enabling authentication and setting a password on the roles you use. See Quick Start for how to enable it.
Command line: psqlβ
psql -h localhost -p 5432 -U scramdb scramdb
Everything you expect from psql works: \dt to list tables, \d table to describe one, \timing to measure queries, and running .sql files with -f.
Drivers by languageβ
Use the standard PostgreSQL driver for your language. No adapter, no shim.
| Language | Driver | Connection string |
|---|---|---|
| Python | psycopg (psycopg3) or psycopg2 | postgresql://scramdb@localhost:5432/scramdb |
| Java | PostgreSQL JDBC | jdbc:postgresql://localhost:5432/scramdb |
| Node.js | pg | postgresql://scramdb@localhost:5432/scramdb |
| Go | pgx or lib/pq | postgres://scramdb@localhost:5432/scramdb |
| Rust | tokio-postgres | host=localhost port=5432 user=scramdb dbname=scramdb |
| .NET | Npgsql | Host=localhost;Port=5432;Database=scramdb |
Pythonβ
import psycopg
with psycopg.connect("postgresql://scramdb@localhost:5432/scramdb") as conn:
with conn.cursor() as cur:
cur.execute("SELECT count(*) FROM orders")
print(cur.fetchone())
Java (JDBC)β
String url = "jdbc:postgresql://localhost:5432/scramdb";
try (Connection conn = DriverManager.getConnection(url, "scramdb", "")) {
try (Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("SELECT count(*) FROM orders")) {
while (rs.next()) System.out.println(rs.getLong(1));
}
}
Node.jsβ
import { Client } from 'pg';
const client = new Client({ connectionString: 'postgresql://scramdb@localhost:5432/scramdb' });
await client.connect();
const { rows } = await client.query('SELECT count(*) FROM orders');
console.log(rows[0]);
await client.end();
GUI and BI toolsβ
Because the wire protocol is PostgreSQL, tools that speak to PostgreSQL connect to ScramDB the same way. Choose the PostgreSQL connection type and enter the host, port, database, and credentials:
- pgAdmin, DBeaver, DataGrip for querying and browsing schemas
- Grafana and other BI tools, using their PostgreSQL data source
Connection settingsβ
| Setting | Default | Notes |
|---|---|---|
| Host | localhost | The address ScramDB is listening on |
| Port | 5432 | The standard PostgreSQL port |
| Database | scramdb | The database to connect to |
| User | scramdb | Bootstrap superuser role, no password by default. Create additional roles with CREATE ROLE |
| Password | none by default | Set one with ALTER ROLE scramdb WITH PASSWORD '...' once authentication is enabled |
Connecting to a clusterβ
Everything above is unchanged against a cluster: same driver, same DSN shape, same SQL. Every node serves every table, so one pool against any node is the correct default and there is no coordinator or proxy to run. The one thing worth reading before you ship is the retry contract, which is three SQLSTATEs your ORM most likely already handles: Connecting to a cluster, with the full code list in Error codes.
See PostgreSQL Compatibility for the full list of supported features, and Get Started to connect for the first time.