On this page

Defined in cli/commands/data.ts. Bulk SQL table import/export/wipe, plus single-organization copy, against the bound database.

ds data import#

ds data import <path> [-t <tables>]

Bulk-restores SQL tables from a directory previously produced by ds data export.

Flag Description
<path> (required, positional) Directory to import from
-t, --tables <tables> Comma-separated list of table names to import (default: all tables)

Dev/staging only

Blocked on prod.

ds data export#

ds data export [path] [-t <tables>]

Dumps SQL tables to disk as chunked JSON files, one directory per table.

Flag Description
[path] (optional, positional) Output directory. Default: .ds/data/<DEVSTRIDE_STAGE>
-t, --tables <tables> Comma-separated list of table names to export (default: all tables)

Output lands under <path>/sql/<tableName>/0.json, 1.json, … (1000 rows per chunk). The workflowRuns table is always excluded.

ds data wipe#

ds data wipe [-t <tables>]

Deletes all rows from the selected (or all) SQL tables. Temporarily sets session_replication_role = 'replica' to bypass FK constraint ordering while deleting.

Flag Description
-t, --tables <tables> Comma-separated list of table names to wipe (default: all tables)

Blocked on prod

Refuses to run when DEVSTRIDE_STAGE === "prod".

ds data copy#

ds data copy [-o <organization>] [-s <source>]

Org-scoped copy: pulls one organization's data from a source database into the bound database. Within a table whose rows point at a parent row in the same table (board folders, cadences, time boxes, knowledge-base categories), parents are copied before their children, so the database's parent checks never stop a copy part-way.

Flag Description
-o, --organization <organization> Organization ID to copy. Default: 970b8dea-c8b4-44d8-8aaf-febf3f25138a (the historical demo org; ds script reset-db no longer copies it — it builds the golden Acme org instead)
-s, --source <keyOrUrl> Source DB: either the name of an env var (e.g. GOLDEN_DB_CONNECTION_STRING) or a full connection string. Omitted in an interactive terminal, you get a picker over the *_CONNECTION_STRING vars in .env; omitted non-interactively, it defaults to SOURCE_DB_CONNECTION_STRING

Steers away from golden orgs

ds data copy is marker-unaware — it shares the underlying copyOrgData helper with ds golden import, but it does not reset the stage's golden_handle.anchorIso marker. If the organization ID you pass is one of the golden persona orgs, the command prints a warning and recommends ds golden import (or a follow-up ds golden reanchor --to today) instead, so a later reanchor doesn't compute its shift from a stale anchor.


Powered by DevStride