Skip to content
dbSDK
Esc
↑↓navigate↵open⌘Jpreview

All your databases.In the palm of your hand.

Create, manage, and query databases with one SDK.

Sponsors.

  • AWS
  • Google Cloud
  • Supabase
  • Neon
  • Heroku
  • PlanetScale
  • Convex
  • PostgreSQL

Supported and planned brands. The compatibility table has the per-capability status.

One flow. Same verbs.

Provision with the management layer, connect through the adapter, and query with one client. The imports and options change per provider; the verbs do not.

import { createDatabase } from "dbsdk";
import { supabase } from "dbsdk/supabase";
import { createManagement } from "dbsdk/management";
import { supabaseManagement } from "dbsdk/management/supabase";

const management = createManagement({
  adapter: supabaseManagement({
    accessToken: process.env.SUPABASE_ACCESS_TOKEN!, // sbp_... personal access token
  }),
});

// 1. Provision: create the project, then wait until it is active.
const result = await management.create({
  kind: "project",
  name: "my-app",
  organizationId: "my-org-slug", // from management.organizations()
});
const project = await management.wait(result, { timeoutMs: 120_000 });

// 2. Connect to the project you just created: the creation-time password
//    (shown once, in result.secrets) and the real host from the API.
const password = result.secrets.find((s) => s.label === "password")!.value;
const host = await management.raw.databaseHost(project.id);
const db = createDatabase({
  adapter: supabase({
    connectionString: `postgresql://postgres:${encodeURIComponent(password)}@${host}:5432/postgres`,
    connectionMode: "direct",
  }),
});

// 3. Query: one bound parameter, works on a fresh database.
try {
  const value = "hello from dbSDK";
  const { rows } = await db.sql`select ${value}::text as value`;
  // rows[0].value === "hello from dbSDK"
} finally {
  await db.close();
}

Real factories, real option names, in this order:dbsdk, dbsdk/management, and one adapter entry per provider. The full walkthrough is ingetting started andmanagement. For typed schema queries on the same dbSDK-owned connections, the optional Drizzle bridge is covered in drizzle.

01

Provision

Create a project or database through your provider's own control plane with one verb: create, then waituntil it is ready. Your credentials stay yours.

02

Manage

One verb set over every provider's resources:list, get, update,delete, lifecycle actions, and credential rotation. Refusals are explicit, never silent.

03

Query

One typed SQL client: parameterized queries, transactions, and atomic batches. The same result envelope on every adapter, on every transport.

Compatibility.

One SDK across the major database services. Here is exactly where each provider stands.

ProviderCreateManageQuery
AWS RDSPlannedPlannedPlanned
AWS AuroraPlannedPlannedPlanned
Google Cloud SQLPlannedPlannedPlanned
Google AlloyDBPlannedPlannedPlanned
SupabaseSupportedSupportedSupported
NeonSupportedSupportedSupported
PlanetScale PostgresSupportedSupportedSupported
PlanetScale VitessPlannedPlannedPlanned
HerokuPlannedPlannedPlanned
ConvexPlannedPlannedPlanned
PostgreSQLNot applicableNot applicableSupported

Supported Planned Not applicable

PlanetScale Postgres and Vitess have separate adapters. Seeprovider capabilities for the per-capability detail.

Start from source.

dbSDK is installed from source today. Clone the repository, add your provider credentials, and follow the guide. The SDK test suite covers every release.

Readable by agents.

Every page of this site is also available as Markdown and structured data, so humans and coding agents read the same source of truth.

Connect a provider. Make your first query.