Postgres
First SQL driver: connection, introspection from information_schema, parameterized SELECT, limits and timeouts.
PostgreSQL is the first SQL driver. It should prove the core stays driver-agnostic: connection, introspection, parameterized SELECT, limits, and timeouts — not a SQL-shaped core that Firestore has to fake.
import { connect } from "@db-sdk/core";
import { postgres } from "@db-sdk/postgres";
const db = await connect({
provider: postgres({
connectionString: process.env.DATABASE_URL,
}),
});
await db.test();
const catalog = await db.introspect();
const users = await db.query({
sql: "SELECT id, email FROM users WHERE plan = $1",
params: ["pro"],
});Intended query controls
- Reject statements that are not SELECT or WITH … SELECT
- Reject mutation, DDL, and multi-statement batches
- Use parameterized queries — values are never concatenated
- Enforce a row cap even if the query omits LIMIT
- Enforce a statement timeout
Keep going
Reference
Firestore driver
First document driver: catalog from collections and samples, read APIs only, required limits — never SQL-over-Firestore.
Guide
Architecture
One core, drivers for database types, hosted providers that reuse a driver. Shared lifecycle, native queries, one catalog shape.
Reference
Read-only role checklist
What the host, the customer, and the SDK each own. Prefer a dedicated SELECT-only user or read-only IAM principal.