514 clickhouse seed
Use 514 clickhouse seed to copy rows from a source branch's ClickHouse database into the current branch. This is useful for populating a feature branch with realistic data from production or another branch.
Usage
514 clickhouse seed [OPTIONS] <TABLE>Arguments
<TABLE>: Name of the ClickHouse table to seed.
Options
-
-l, --limit <LIMIT>: Maximum number of rows to copy. Pass0for no limit. -
-w, --where <CLAUSE>: SQLWHEREclause to filter which rows are copied. -
-f, --from <BRANCH>: Source branch to copy data from. Defaults to the project's production branch. -
-b, --branch <BRANCH>: Target branch name. Defaults to the current git branch. -
--project <PROJECT>: Project reference:<org>/<project>, project name, project ID, or URL. -
--api-url <API_URL>: API base URL override (HOSTING_CLI_API_URL). -
-o, --org <ORG>: Organization name or ID. -
--json: Output as JSON. -
-v, --verbose...: Enable verbose output (-vdebug,-vvtrace). -
-h, --help: Print help.
How It Works
The command executes an INSERT INTO ... SELECT * FROM between two branch databases within the same ClickHouse cluster. Both the source and target tables must already exist — deploy your branch first to create the schema.
Source branch default
When --from is omitted, the source defaults to the project's production (default) branch.
Validation
The command validates inputs before executing:
| Check | Error |
|---|---|
| Source and target are the same branch | "Cannot seed a branch from itself" |
| Source and target resolve to the same database | "Source and target branches resolve to the same database — seeding would duplicate rows" |
| Table not found in source branch | "Table not found in source database" |
| Table not found in target branch | "Table not found in target database. Deploy the branch first to create the schema." |
| No ClickHouse credentials for branch | "No ClickHouse credentials configured" |
Examples
Seed the events table from production into your current branch:
514 clickhouse seed eventsSeed with a row limit:
514 clickhouse seed events --limit 1000Seed only recent rows from a specific branch:
514 clickhouse seed events --from staging --where "timestamp > now() - INTERVAL 7 DAY"Seed with explicit project and branch:
514 clickhouse seed events --project acme/analytics --branch feature/dashboard --from main --limit 5000JSON Output
Use --json for machine-readable output:
514 clickhouse seed events --limit 100 --json{ "table": "events", "rows_inserted": 100, "elapsed_ms": 1250}Related
514 clickhouse- Branch Data Seeding — automatic seeding during branch deploys
- Seed Filter (OlapTable config) — per-table seed filter configuration
moose seed clickhouse— seed a local development database from a remote source