Quickstart: Connect Your Database
Quickstart: Connect Your Database
Section titled “Quickstart: Connect Your Database”Connect dbward to your existing database and run a query. Dev mode auto-approves everything — perfect for a quick smoke test.
Prerequisites: PostgreSQL or MySQL running and accessible.
1. Install
Section titled “1. Install”curl -fsSL https://dbward.dev/install.sh | sh2. Start dev mode
Section titled “2. Start dev mode”dbward dev --database-url "postgres://user:password@localhost:5432/mydb"For MySQL:
dbward dev --database-url "mysql://user:password@localhost:3306/mydb"Expected output:
dbward dev starting... Server: http://127.0.0.1:3000 Database: postgres://user:***@localhost:5432/mydb
Admin token: dbw_a1b2c3... Developer token: dbw_d4e5f6...
Config: ~/.dbward/dev/client.toml Try: dbward --config ~/.dbward/dev/client.toml --database app execute "SELECT 1"
Press Ctrl-C to stop.This starts a local server + agent in one process. All queries are auto-approved.
3. Run a query
Section titled “3. Run a query”In another terminal:
dbward --config ~/.dbward/dev/client.toml --database app execute "SELECT version()"Expected output:
version────────────────────────── PostgreSQL 17.2 ...(1 row)
Completed in 45msIf you see the result, dbward is correctly connected to your database.
4. Try the CLI
Section titled “4. Try the CLI”# List requestsdbward --config ~/.dbward/dev/client.toml request list
# View audit traildbward --config ~/.dbward/dev/client.toml auditAdding approval to your setup
Section titled “Adding approval to your setup”Dev mode auto-approves everything. To require approval for production queries, create a config file (dbward-server.toml):
state_dir = "./data"
[[databases]]name = "app"environments = ["development", "production"]
# Development: auto-approve[[workflows]]environment = "development"steps = []
# Production: require admin approval[[workflows]]environment = "production"
[[workflows.steps]]type = "approval"
[[workflows.steps.approvers]]role = "admin"min = 1Then run the server and agent separately instead of dbward dev. See the Deployment Overview for production options.
About dbward dev
Section titled “About dbward dev”dbward dev is a convenience shortcut that:
- Writes a minimal server config to
~/.dbward/dev/server.toml - Starts
dbward-serverwith auto-approve for all environments - Waits for bootstrap tokens
- Starts
dbward-agentconnected to your database - Prints a
client.tomlpath for the CLI
In production, you run the server and agent as separate processes (or containers). See the Deployment Overview for details.
See also
Section titled “See also”- Try with Docker — full approval flow demo with submit → approve → execute
- Deploy to production — choose a deployment method for your team
- MCP Integration — connect AI agents (Claude, Cursor)