We value your privacy

This site uses cookies to improve your browsing experience, analyze site traffic, and show personalized content. See our Privacy Policy.

  1. Hosting
  2. clickhouse
  3. clickhouse seed

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. Pass 0 for no limit.

  • -w, --where <CLAUSE>: SQL WHERE clause 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 (-v debug, -vv trace).

  • -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:

CheckError
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 events

Seed with a row limit:

514 clickhouse seed events --limit 1000

Seed 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 5000

JSON 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

On this page

UsageArgumentsOptionsHow It WorksValidationExamplesJSON OutputRelated
Edit this page
FiveonefourFiveonefour
Fiveonefour Docs
MooseStackHostingTemplatesGuides
Release Notes
Source563
  • Hosting Overview
CLI
  • --help
  • auth
  • org
  • project
  • deployment
  • doc
  • cli
  • env
  • agent
  • clickhouse
    • seed
Resource Commands
  • api-endpoint
  • stream
  • function
  • stream-to-table-sync
  • stream-to-stream-sync
  • table
  • view
  • web-app
  • workflow
  • sql-resource
  • materialized-view
Workflow
  • Fiveonefour to Local Setup
  • Manage Environment Variables
  • Branch Data Seeding
Integrations
  • Vercel
Troubleshooting
  • Setup Failures