Postgres
but for agents

Create, manage, and query serverless PostgreSQL databases from your terminal. Branching, migrations, observability, type generation — all built in.

$ curl -fsSL https://staging.db9.ai/install | sh
macOS / Linux (x86_64, arm64)
AI Agents

Send this to your agent

Read https://staging.db9.ai/skill.md and follow the instructions to use db9
Your agent will learn how to install, authenticate, and use db9 autonomously
db9
$ db9 db create --name myapp Database created successfully!   ID: x9y8z7w6v5u4 Name: myapp State: ACTIVE Admin User: admin Admin Pass: aB3kL9mP2xQr   Connection String: postgresql://x9y8z7w6v5u4.admin:aB3kL9mP2xQr@pg.shared.aws.tidbcloud.com:5433/postgres   $ db9 db sql x9y8z7w6v5u4 -q "CREATE TABLE users (id serial, name text, email text)" CREATE TABLE   $ db9 db sql x9y8z7w6v5u4 -q "INSERT INTO users (name, email) VALUES ('Alice', 'alice@example.com')" INSERT   $ db9 db sql x9y8z7w6v5u4 -q "SELECT * FROM users" id name email ── ───── ───────────────── 1 Alice alice@example.com (1 rows)   $ db9 gen types x9y8z7w6v5u4 --lang typescript // Generated by db9 gen types   export interface Users { id: number; name: string; email: string; }

Everything you need

From database creation to production monitoring, db9 covers the full lifecycle.

Instant databases

Spin up a serverless Postgres instance in seconds. No provisioning, no config files.

🔒

TLS everywhere

All connections encrypted with TLS. Supports sslmode=verify-full out of the box.

📑

SQL from CLI

Execute queries inline, from files, or pipe from stdin. Output as table, JSON, or CSV.

🌱

Database branching

Create schema branches for testing and development. Isolated environments in one command.

📈

Built-in observability

Inspect QPS, latency, slow queries, and connection metrics without external tools.

🛠

Migration management

Create, apply, and track SQL migrations. Integrated status tracking per database.

📝

Type generation

Generate TypeScript or Python types from your database schema automatically.

👥

User management

Create and manage database users with granular permissions directly from your terminal.

📦

Dump & seed

Export schemas and data as SQL. Seed databases from files for reproducible environments.

📁

Cloud filesystem

Read, write, and manage files per database via the SDK or interactive shell. Built for RAG pipelines and file-driven workflows.

30+ commands

A comprehensive toolkit for every database operation.

db9 db create --name myapp

Create a serverless Postgres database

db9 db sql <id> -q "..."

Execute SQL queries directly

db9 db branch create <id> --name dev

Branch a database for dev/test

db9 db inspect <id>

View QPS, latency, and metrics

db9 gen types <id> --lang typescript

Generate TS/Python types from schema

db9 migration up <id>

Apply pending migrations

db9 db dump <id> -o backup.sql

Export database as SQL

db9 db connect <id>

Get connection string for psql

db9 fs sh <id>

Interactive filesystem shell

db9 fs cp local.txt <id>:/data/

Upload files to cloud filesystem

Start building in seconds

One command to install. One command to create a database. Zero config.

$ curl -fsSL https://staging.db9.ai/install | sh