ReferenceCLI commands
sdods data, db
Import and preview datasets; migrate, inspect and switch the platform database.
data
sdods data preview <file> [--limit <n>]
sdods data import <dataset> <file> -p <slug> [-e <env>] [--to db|table] [--truncate]
sdods data list -p <slug>
sdods data seed -p <slug> [-e <env>] [--to db|table]| Command | Purpose |
|---|---|
preview | first rows and inferred columns of a CSV, JSON or YAML file |
import | load a file into datasets/dataset_rows (--to db) or into a td_<project>_<dataset> table (--to table); -e scopes rows to an environment (default *); --truncate replaces rows for that environment |
list | datasets stored in the database for a project |
seed | import every file under projects/<slug>/data/<env>/ and data/common/ |
db
sdods db migrate [--to <name>] [--down]
sdods db status
sdods db sync
sdods db reset --yes # sqlite only
sdods db switch <sqlite|postgres> [--target-url <url>] [--target-path <file>] [--dry-run] [--truncate] [--env-file <file>] [--yes]
sdods db export <dir>
sdods db import <dir>
sdods db prune [--keep-runs <n>] [--keep-days <n>] [-p <slug>] [--dry-run]
sdods db stats
sdods db retention [--keep-runs <n>] [--keep-days <n>] [--auto on|off]
sdods db backup [--out <dir>]
sdods db backups [--dir <dir>]
sdods db restore <dir> --yes
sdods runs rm <id...> [--dry-run] [--yes]| Command | Purpose |
|---|---|
migrate | apply pending migrations (creates the SQLite file on first use); --to targets one migration, --down rolls back one |
status | applied and pending migrations |
sync | upsert organization, workspaces, projects, modules and processes from sdods.workspace.yaml and the project YAML files |
reset | drop every SDODS table (SQLite only); see Reinstall or reset |
switch | migrate the target, copy every table, verify row counts and rewrite DB_DRIVER / DATABASE_URL / SQLITE_PATH in the env file (--dry-run only verifies) |
export | one JSONL file per table |
import | load JSONL files with ON CONFLICT DO NOTHING |
prune | delete old runs and their artifact directories; runs still queued or running are skipped, and every delete is audited |
stats | which database is in use (SQLite path or redacted Postgres URL), its size, artifact size, row counts, oldest and newest run, migration state |
retention | show or set how much run history to keep; with --auto on, sdods serve applies it once a day (0 clears a limit) |
backup | write every table to .sdods/backups/<timestamp>/ (JSONL + manifest.json) |
backups | list backups, newest first |
restore | replace the database contents with a backup; a pre-restore backup of the current data is taken first |
runs rm | delete specific runs, their results and artifact folders; --dry-run previews |
Environment: DB_DRIVER (sqlite default, postgres), DATABASE_URL, SQLITE_PATH (default .sdods/sdods.db), SDODS_ARTIFACTS_DIR (default .sdods/runs), SDODS_BACKUPS_DIR (default .sdods/backups).
Every one of these is also in the web UI under Settings → Data & storage (admins), and runs can be deleted from the Runs page.