Generate test row for
generate_test_row_forCreates a single realistic test row for a database table, using column-name heuristics and foreign key sampling to produce a valid INSERT statement for shadow migration testing.
Instructions
Generate ONE realistic test row for a table — catalogue-aware. Skips identity / generated columns (server fills them in), samples one existing row from each referenced table for FK columns (so the row inserts cleanly), and uses column-name heuristics (*_email → user_N@example.com, *_url → https://example.com/r/N, *_at → recent timestamp, etc.) to make values look like data. Sibling of generate_test_data (bulk) — designed for the shadow-migration workflow where a single realistic row matters more than volume. Returns an object with insert_sql (one ready-to-execute INSERT), columns (per-column ColumnFill with sql_literal + heuristic explanation), schema, table. Does NOT execute the INSERT — caller applies via run_write when ready.
Example: generate_test_row_for(schema='public', table='orders', seed=42)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| table | Yes | ||
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| follow_foreign_keys | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | Yes | ||
| columns | Yes | ||
| insert_sql | Yes |