feat(seed): command plumbing + walking skeleton (ADR-0048 P1.2)
End-to-end `seed <table> [count]` path, both modes: - Command::Seed AST + grammar node (show-data table slot + optional positional count) + REGISTRY registration + build_seed. - Runtime dispatch -> Database::seed -> Request::Seed worker arm -> do_seed. - do_seed (Phase-1 skeleton): generates whole rows for non-FK, non-autogen columns via the seed library and inserts them one at a time through do_insert (reusing validation / autogen autofill / FK-error / persistence). One undo step (snapshot_then wraps it) and one history.log line (only the first row carries the source); default count 20. - help (`help seed`) + parse-usage catalog entries. - Reuses CommandOutcome::Insert for the auto-show; a dedicated SeedResult (capped preview + advisory) replaces it in P1.3. 5 Tier-3 integration tests (parse, populate+persist, default-20, reproducible --seed, one history line). 2327 pass / 0 fail / 0 skip, clippy all-targets clean. Deferred to P1.3: FK sampling, identifier/constraint uniqueness, CHECK derivation, block guard, capped preview, advisory, multi-row path. Deferred to P1.4: completion/highlight/hint/validity wiring + --seed flag.
This commit is contained in:
@@ -2911,6 +2911,17 @@ async fn execute_command_typed(
|
||||
.insert(table, columns, values, src)
|
||||
.await
|
||||
.map(CommandOutcome::Insert),
|
||||
// ADR-0048 (SD1). Phase 1 reuses the insert outcome for the
|
||||
// auto-show; a dedicated `SeedResult` (capped preview +
|
||||
// enum/CHECK advisory) replaces this in a later phase.
|
||||
Command::Seed {
|
||||
table,
|
||||
count,
|
||||
rng_seed,
|
||||
} => database
|
||||
.seed(table, count, rng_seed, src)
|
||||
.await
|
||||
.map(CommandOutcome::Insert),
|
||||
Command::Update {
|
||||
table,
|
||||
assignments,
|
||||
|
||||
Reference in New Issue
Block a user