Skip to content

rai db

SQLite personal database diagnostics and backup. These commands operate on the local RaiSE database at ~/.rai/raise.db (canonical) and the per-project replica at .raise/rai/raise.db.

Do not modify .raise/**/*.db files directly. Always use the CLI to prevent data loss or schema corruption.

rai db check

Run integrity checks on the local SQLite database. Reports any corruption, schema drift, or version mismatches.

rai db check

rai db status

Show database status — path, size, schema version, last migration, and record counts.

rai db status

rai db consolidate

Merge the per-project replica into the global canonical database at ~/.rai/raise.db. Use after switching machines or worktrees.

rai db consolidate
rai db consolidate --project .

rai db migrate

Apply pending schema migrations to the local database.

rai db migrate

rai db export

Export database contents to a portable format (JSON or SQL dump).

rai db export --output backup.json
rai db export --format sql --output backup.sql

rai db import

Import a previously exported backup into the local database.

rai db import backup.json

See also: rai doctor, rai session