Introduction
Connect, introspect, and read databases whose schema you do not control at compile time.
DB SDK is a TypeScript library for runtime access to databases through providers and drivers. It is not an ORM and not an AI framework.
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"],
});test, introspect, query, and close are the same for every provider. The query input is not. Postgres speaks SQL. Firestore does not. Hosted providers such as Supabase open a shared driver and keep the same SQL shape.