dbSDK
Resources

Core idea

Connect, describe, and read a database whose schema you don't control at compile time — without turning every driver into SQL.

docs/core-idea.md

DB SDK is a runtime database adapter. It gives an application one way to connect, describe, and safely read a data store — including a store it only learned about at runtime.

Connect to a database whose schema you don't control at compile time, understand what is in it, and run a bounded read through a shared interface, without forcing every driver into one query language.

Not an ORM

If Postgres is your application database, use an ORM. If the product must attach to someone else's database — or to several different ones in one workflow — use DB SDK.

ORMDB SDK
Whose database?YoursOften the customer's
When is the schema known?Compile time, in a file you wroteRuntime, after introspect()
Do drivers change?Rarely; you picked onePer connection, at runtime
Query styleTyped API generated from your schemaProvider-native, then validated
Writes and migrations?YesNever — query-only

Not an AI framework

DB SDK does not talk to a model and does not take an AI API key. An AI-powered host may call introspect(), let its own model draft a provider-native query, then send that query to DB SDK. The generated query is untrusted input — the same as a query typed by a human.

Shared lifecycle, native queries

Every provider implements the same verbs. The catalog is shared so UIs and models have one picture of what exists. The query language is not. PostgreSQL takes SQL. Firestore takes collection queries. Hosted providers (Supabase) open a shared driver (Postgres).

lifecycle.ts
connect({ provider })  →  test  →  introspect  →  query  →  close