Capabilities
What each dbSDK adapter and transport supports, with the evidence behind each cell.
Every adapter declares its capabilities, and the client enforces them before
any network traffic. There is no silent fallback: if a transport cannot do
something, the call fails with a DbError of code CAPABILITY and nothing
is sent. This page states the current matrix and the evidence behind it.
The same discipline applies to the management layer: every resource kind
and verb is declared per provider and enforced before dispatch, with its
own table below.
The matrix
| Capability | postgres (TCP) | supabase direct | supabase session | supabase transaction | planetscale direct | planetscale pooled | neon http | neon + websocket tx | neon + postgres tx |
|---|---|---|---|---|---|---|---|---|---|
| Transport | tcp | tcp | tcp | tcp | tcp | tcp | http | http (queries) | http (queries) |
Parameterized query() |
yes | yes | yes | yes | yes | yes | yes | yes | yes |
Interactive transaction() |
yes | yes | yes | yes, one leased connection | yes | yes, one leased connection | refused before dispatch | yes, short-lived WebSocket pool per transaction | yes, pg pool against the direct endpoint |
Atomic batch() |
yes | yes | yes | yes | yes | yes | yes, native single HTTP round trip | yes | yes |
| Session state | on a leased session | on a leased session | on a leased session | guarded before dispatch | on a leased session | guarded before dispatch | no | no on pooled hosts, yes on direct | no on pooled hosts, yes on direct |
| Reusable named prepared statements | no | no | no | no | no | no | no | no | no |
Status words used in this table and in code:
- supported: the operation runs.
- refused before dispatch: the client throws
CAPABILITYbefore any network traffic. Example:transaction()on Neon HTTP. - guarded before dispatch: session-state statements (
SET,RESET,LISTEN/NOTIFY,PREPARE/DEALLOCATE,CREATE TEMP,DECLARE ... WITH HOLD) are rejected before dispatch on the Supabase transaction pooler, because that pooler cannot carry them. Disable withenforceSessionRestrictions: falseif you know your deployment allows it. - not supported: the capability does not exist for that transport.
The two PlanetScale Postgres columns share the Supabase transaction pooler’s
guard semantics on the pooled path (6432, PgBouncer), plus the adapter’s
mandatory verified-TLS policy and explicit direct/pooled port validation —
details and evidence in the PlanetScale Postgres adapter.
If you use Drizzle ORM, the optional dbsdk/drizzle bridge preserves exactly
these guarantees on the same pool; see Drizzle. The optional
dbsdk/orm subpath is the matching schema-authoring surface: a pure re-export
of stable drizzle-orm (root + pg-core, PostgreSQL authoring only) with no
runtime capabilities of its own — no connections, no dispatch, no capability
rows in the table above. Everything a dbsdk/orm-authored schema executes
inherits the adapter/transport capabilities of the dbsdk/drizzle bridge it
runs through; the per-adapter rows in this matrix remain the source of truth.
What “session state” means here
capabilities.sessionState: true means session-level state (SET, temporary
objects, LISTEN/NOTIFY, session advisory locks) works on a single
dedicated session: inside transaction(), which leases exactly one
connection, or on a client you lease yourself through raw.
It does not mean state persists between separate top-level queries. Pool
backed adapters may use a different pooled connection for each db.sql
call, so this does not stick:
await db.sql`set statement_timeout = '5s'`; // applies to one pooled session
await db.sql`show statement_timeout`; // may run on another session
Inside transaction(), it does stick, because the callback runs on one
leased connection. If you need session-scoped state across calls, hold a
client from raw or run the work inside a transaction.
Batches and transactions are different tools
db.transaction(fn)runs your callback with multi-round-trip logic on one connection. It needs an interactive-transaction capability.db.batch(statements)is atomic by default: on Neon HTTP it is a single round trip through the driver’s native batch; on TCP transports it leases one connection and wrapsBEGIN/COMMITaround the statements. Neither form accepts control flow between statements; if you needif, usetransaction().
Parameterized binding is available on every row of the table. It does not depend on prepared statements: dbSDK uses unnamed protocol statements and never creates reusable named prepared statements, so binding keeps working even on the Supabase transaction pooler, where named prepared statements cannot.
Evidence levels
Every capability carries an evidence level, also exposed at runtime in
db.capabilities.evidence:
docs: stated by official provider documentation, not executed by this project.tests: verified by this project’s automated tests (fixture or contract tests, and live checks against local servers).live: verified against the real hosted service.
The current runtime levels are conservative and deliberately so: the
postgres adapter declares tests (its behavior is verified by this
project’s automated tests against a real local Postgres 17 container), while
the Supabase, Neon, and PlanetScale adapters declare docs for every
capability - their transport facts come from provider documentation. The local
verification runs are real and reproducible: a local Postgres 17 container,
the Neon HTTP protocol through a local proxy, and the Supabase and PlanetScale
adapters against a local server exercised the transaction-pooler paths
(commands below and in
CONTRIBUTING).
Hosted Supabase, Neon, and PlanetScale endpoints have not been queried by this
project, and no table on this site claims otherwise.
The runtime surface
console.log(db.capabilities);
// {
// interactiveTransactions: false,
// atomicBatch: true,
// sessionState: false,
// transport: "http",
// evidence: { interactiveTransactions: "docs", atomicBatch: "docs", ... }
// }
Check db.capabilities when writing transport-sensitive code instead of
branching on the adapter id. The adapter id can gain new transports; the
capability flags are the contract.
Management capabilities
The management layer uses the same pattern with a richer vocabulary: per
resource kind (project, branch, database, plus provider-defined
kinds) and per verb (create, list, get, update, delete),
declared by the adapter and enforced before dispatch. The structured
source at runtime is describeManagementCapabilities(adapter) from
dbsdk/management; docs and grids render from it.
| Capability | Neon management | Supabase management | PlanetScale management |
|---|---|---|---|
project create/list/get |
yes | yes | yes (PlanetScale’s database is the project kind) |
project update/delete |
yes | yes | yes |
branch lifecycle |
yes; writes are async operations | yes (the Environments API); branch create is synchronous | create/delete; branch update refused (official PATCH unverified — not guessed) |
database |
yes; branch-scoped, addressed by name | refused (CAPABILITY): a Supabase project is the database |
refused (CAPABILITY): a PlanetScale database is the project kind |
role, endpoint, snapshot |
yes: branch-scoped role credentials; compute with start/suspend/restart; snapshots with restore | no such kinds in the official API | role only: Postgres role credentials, scoped to a database + branch, addressed by uid |
| Organizations / regions | yes; regions() forwards a supplied organizationId as org_id |
yes; regions() requires organizationId |
yes; all CRUD is organization-scoped (factory organization is the required owner); discovery may target other orgs |
connection(ref) |
yes; database and role name required by the official endpoint; redacted unless reveal: true |
yes; project and branch; redacted unless reveal: true |
yes; project, branch, and role; always redacted — one-time role passwords surface only via secrets, never via connection() |
| Lifecycle actions | endpoint start/suspend/restart; restore on branch and snapshot |
project pause/restart/resume (resume = the official un-pause restore); branch reset/restore (restore cancels a scheduled deletion) |
none declared: no pause/restart-style endpoints exist for PlanetScale Postgres |
resetCredential(ref) |
yes for role (server-generated) |
yes for project (generated when omitted; the create-time password cannot be recovered, only rotated) |
yes for role (server-generated; caller passwords refused with zero requests; raw.renewRole extends expiration) |
| Recover deleted project | yes (raw.recoverProject) |
no such endpoint | no such endpoint |
| Pagination | projects and branches; not the database list | none | page-based on all implemented lists; limit above the official max of 100 is refused |
| Async operations | yes; wait() polls the operations endpoint |
none; wait() polls resource status |
none; wait() polls resource status (project, branch, role all expose readiness) |
| Credential | Neon API key | Supabase personal access token (sbp_...) |
PlanetScale service token (tokenId + tokenSecret; Authorization: <id>:<secret>, no Bearer) |
Not covered (official endpoints exist, not implemented, never claimed as
supported): Supabase backups/PITR restore and the project health, read
replica, and config endpoints; Neon single-org detail, branch
set_as_default, backup schedules, and restricted actions; PlanetScale
branch PATCH, backups/restore, deploy requests, IP restrictions, and
bouncers. Vitess/MySQL and the Neki preview are separate systems this
adapter family does not model. The full remaining-gap list lives in the
release coordination notes.
Evidence for the management facts is docs: the behavior comes from the
providers’ official API documentation and the frozen management contract,
and the adapters map the contract fields onto each provider’s current API.
One concrete example: Supabase’s current create-project endpoint takes an
organization scope and no longer accepts a plan, so the SDK refuses a
spec that includes one (CONFIGURATION) and maps a spec region to the
official region_selection form.
Availability means “implemented and declared”; it never certifies
credentials, plan tier, or a successful live request. Full lifecycle
detail: Management.
Reproducing the local verification
The test suite runs without any database (fixtures only), and the live local checks run against real servers you start yourself:
docker run -d --name dbsdk-pg-test -e POSTGRES_PASSWORD=dbsdk -e POSTGRES_DB=dbsdk -p 15432:5432 postgres:17-alpine
docker run -d --name dbsdk-neon-proxy \
-e PG_CONNECTION_STRING='postgres://postgres:dbsdk@host.docker.internal:15432/dbsdk' \
-p 14444:4444 ghcr.io/timowilhelm/local-neon-http-proxy:main
DBSDK_TEST_POSTGRES_URL='postgres://postgres:dbsdk@localhost:15432/dbsdk' \
DBSDK_TEST_NEON_CONNECTION_STRING='postgres://postgres:dbsdk@db.localtest.me:5432/dbsdk' \
DBSDK_TEST_NEON_HTTP_ENDPOINT='http://localhost:14444/sql' \
pnpm --filter dbsdk test
The suite has three layers. Offline tests run against fixtures and fake provider transports, so they need no database and no network. The live-local checks connect to the real servers started above (a local PostgreSQL over the standard wire protocol, and a local Neon-compatible HTTP proxy) and skip automatically when those servers are not running or their environment variables are not set. Hosted checks that use real provider credentials are a separate opt-in layer outside the default run, so a local pass never certifies a hosted endpoint.
