docs(website): document the seed command, with cast (ADR-0048)

New Reference page "Generating sample data" (captured output + a
two-table seed cast showing generation, FK sampling context, and a
`set` override); cross-links from inserting-and-editing-data and
columns; seed added to the rdbms highlight grammar;
querying/sql-queries renumbered. Cast stance in STYLE.md revised to
"justify the absence". Refs #33, #34.
This commit is contained in:
claude@clouddev1
2026-06-12 14:41:37 +00:00
parent 4691d7950a
commit 77c55fa669
9 changed files with 933 additions and 19 deletions
+36
View File
@@ -78,6 +78,42 @@ export const casts = [
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
name: 'seed',
title: 'Fill a table with realistic, ready-to-query data in one command',
width: 90,
// Two seeds: a people table (`name` → real names, `joined` → recent dates,
// which seed nails today) and a tickets table that mixes a free-text column
// (`subject`), an auto-detected `priority` (short once #34 lands — until
// then a fresh recording fills it with placeholder text), and a `status`
// pinned via `set status in (...)` to show the override clause. Re-record
// in the final sweep once #34 is in.
height: 28,
typeSpeed: '45ms',
steps: [
{ wait: 1000 },
// A people table — seed reads the column names to choose what to make.
{ type: 'create table members with pk member_id(serial)', after: 650 },
{ type: 'add column to members: name (text)', after: 650 },
{ type: 'add column to members: joined (date)', after: 800 },
// The payoff: one line, eight believable rows. Split type + Enter so the
// command reads before the table lands.
{ type: 'seed members 8', enter: false, after: 1500 },
{ key: 'Enter', after: 2800 },
{ caption: 'One line fills a table with realistic, ready-to-query data.', after: 3000 },
// A second table: a free-text column (`subject`), an auto-detected one
// (`priority`), and `status` pinned to a value set with `set`.
{ type: 'create table tickets with pk ticket_id(serial)', after: 650 },
{ type: 'add column to tickets: subject (text)', after: 650 },
{ type: 'add column to tickets: status (text)', after: 650 },
{ type: 'add column to tickets: priority (text)', after: 800 },
// `subject` and `priority` are generated; `status` is pinned to a set.
{ type: "seed tickets 8 set status in ('open', 'pending', 'closed')", enter: false, after: 1600 },
{ key: 'Enter', after: 2800 },
{ caption: 'Generate most columns — and pin one to your own values with set.', after: 3000 },
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
],
},
{
name: 'projects',
title: 'Save a project, start fresh, then load it back',