RaisDBRaisDB
CLI

Commands

Every `raisdb` subcommand in detail.

doctor

Diagnose environment + ping every saved connection.

raisdb doctor

Exits 1 if any ping fails or if there are no connections.

connections

list

raisdb connections list

Lists every saved connection (id, name, type, host, port, database). Exits 1 when the list is empty.

Adding / removing / editing connections from the CLI is not supported — manage them in the desktop app.

databases

list

raisdb databases list <conn>

Lists databases on a connection. <conn> accepts a connection name or id.

schema

list

raisdb schema list [conn] [--database <db>]

Lists tables in the current database.

describe

raisdb schema describe <table> [conn] [--database <db>]

Describes a table — columns, indexes, foreign keys.

query

raisdb query <conn> <sql> [--database <db>] [--limit N] [--allow-writes] [--allow-dangerous]

Runs a SQL query. Defaults to read-only.

Positional arguments

  • <conn> — connection name or id (or set RAISDB_CONNECTION)
  • <sql> — SQL string. Prefix with @ to load from a file: @./report.sql

Flags

FlagPurpose
--database / -dDatabase (or RAISDB_DATABASE)
--limit <n>Max rows (default 100)
--allow-writesPermit INSERT / UPDATE / DELETE (still needs --allow-dangerous for DDL)
--allow-dangerousPermit DROP / TRUNCATE / ALTER

The safety checker (check_sql_safety_dialect) is always run. Without the right flag, dangerous SQL exits 3.

context

raisdb context <conn> [--database <db>] [--tables t1,t2] [--max-tables N]

Outputs an AI-ready schema summary (default top-8 tables, columns / types / indexes / FKs). Pipe into any external AI tool. --tables overrides the auto-select.

sync

Default is dry-run. Pass --apply to execute.

sync schema

raisdb sync schema \
  --source <conn> --source-db <db> [--source-schema <s>] --source-table <t> \
  --target <conn> --target-db <db> [--target-schema <s>] --target-table <t> \
  [--apply] [--type-map file.yml]

Diffs source vs target; prints / applies the DDL. If the target table doesn't exist, generates CREATE TABLE first.

sync data

raisdb sync data \
  --source <conn> --source-db <db> --source-table <t> \
  --target <conn> --target-db <db> --target-table <t> \
  [--apply] [--truncate] [--batch-size N] [--where-clause <sql>] [--type-map file.yml]

Dry-run prints a row count estimate; apply runs transfer_data with progress output.

shell

See Shell.

tui

See TUI.

On this page