Ground → your workflow

Turn a Ground export into a SQL fixture

Load the same exported rows into PostgreSQL or a new SQLite database, preserving saved types and detected simple keys.

Start from your dataset’s export controls. Guides are optional; you do not need to visit this page to download your data.

From Ground to your destination

  1. On the dataset page, choose Export options → PostgreSQL fixture (.sql) or SQLite fixture (.sql). Ground validates the saved schema and keys, then downloads the SQL directly. No SDK, API key or extra Ground page is required. Import into an empty development database: psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -f fixture.sql, or sqlite3 fixtures.sqlite < fixture.sql. Direct downloads are bounded to 100,000 total rows, 16 MB input/expanded ZIP and 4 MB SQL output.
  2. Inspect ground schema EXPORT_ID. Metadata comes from the export’s saved specification, rather than the dataset’s current edited version. Single tables use the name dataset; related tables retain their saved names.
  3. Run ground sql for a PostgreSQL script, or ground sqlite for a SQLite file. The converter validates column types and detected primary/foreign keys locally before publishing a new file. PostgreSQL references are added after table creation; inserts run in one transaction with deferred foreign keys.
  4. For PostgreSQL, point DEV_DATABASE_URL at an empty development/test database and load the script with stop-on-error enabled. Existing tables are never dropped or replaced. A SQLite fixture is created in a new file; rerunning against an existing output refuses to overwrite it.
  5. Query table counts and representative joins in the consuming application. SQLite conversion returns per-table counts and runs foreign_key_check and integrity_check. Save the exact artifact and Ground export ID alongside your test.

Optional: use the SDK or CLI

Run this from the Ground source checkout for this release. Package distribution is pending. Keep credentials outside code and notebooks.

python -m pip install -e './sdk/python[pandas]'
# Set GROUND_URL and GROUND_API_KEY in your environment.

Code workflow

# PostgreSQL schema + data
ground sql YOUR_EXPORT_ID --output fixtures.sql
psql "$DEV_DATABASE_URL" -v ON_ERROR_STOP=1 -f fixtures.sql

# Or create a new, checked SQLite fixture
ground sqlite YOUR_EXPORT_ID --output fixtures.sqlite

# Inspect its tables
python -c 'import sqlite3; c=sqlite3.connect("fixtures.sqlite"); print(c.execute("SELECT name FROM sqlite_master").fetchall())'

Verify the result

First slice: up to 100,000 rows and 128 MiB, including uncompressed ZIP members. It converts completed CSV/JSONL/Parquet exports, including existing related-table exports with simple detected keys. Dates remain text to preserve source representations. CSV empty cells are interpreted as null; JSONL/Parquet preserve empty-string distinctions. A single designed table does not gain invented primary/foreign keys. Arbitrary SQL-schema intake, composite-key inference and live database connections remain separate launch work.

When something needs attention

Existing file/table: choose a new output or a fresh disposable database. Constraint failure: inspect the reported table/key and resolve the dataset; the converter does not silently drop rows. Large export: create an intentionally smaller fixture or use a separately verified bulk-load path. Do not run the script against production data. Downloading/converting existing rows does not start another billed generation.

Keep going

API reference · Preview the dataset actions