feat(seed): --seed flag, ambient wiring, and /runda hardening (ADR-0048 P1.4 + DA)
P1.4 — user-visible surface: - Grammar: `seed <table> [count] [--seed <n>]` (the first DSL flag with a value); build_seed disambiguates the seed value from the positional count. - Verified the auto-wired surface: table-name completion, --seed offered as a candidate, validity consistent with `show data`, an ADR-0042 near-miss row for bare `seed`, and render tests for the seed outcome. /runda hardening — eight DA findings, all resolved: - FK sampling now uses ORDER BY so --seed reproducibility no longer relies on SQLite's unspecified DISTINCT order (D4). - shortid columns now generate from seed's seeded RNG (new shortid::generate_with_rng) — D4 now holds with no exceptions. - Added the missing coverage the DA flagged: undo-one-step (D15), replay re-runs a seed line (D16), advanced-mode (D5), atomic rollback on a constraint failure, seed 0 no-op, complex-CHECK advisory (D17), and FK + shortid reproducibility. 2358 pass / 0 fail / 0 skip, clippy all-targets clean.
This commit is contained in:
@@ -100,7 +100,7 @@ fn generic_for_type(ty: Type, rng: &mut SeedRng) -> Value {
|
||||
let words: Vec<String> = lorem::Words(2..4).fake_with_rng(rng);
|
||||
Value::Text(words.join(" "))
|
||||
}
|
||||
Type::ShortId => Value::Text(crate::dsl::shortid::generate()),
|
||||
Type::ShortId => Value::Text(crate::dsl::shortid::generate_with_rng(rng)),
|
||||
Type::Int => Value::Number(rng.random_range(1..=10_000).to_string()),
|
||||
Type::Serial => Value::Number(rng.random_range(1..=10_000).to_string()),
|
||||
Type::Real => {
|
||||
|
||||
Reference in New Issue
Block a user