diff --git a/src/app.rs b/src/app.rs index 733bc6b..68fdc85 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1210,10 +1210,12 @@ impl App { " create table with pk [:...]", " drop table ", " add column [to] [table] : ()", + " (for serial/shortid on a non-empty table: existing rows auto-filled)", " drop column [from] [table] : ", " rename column [in] [table] : to ", " change column [in] [table] : ()", " [--force-conversion | --dont-convert]", + " (to serial/shortid: null cells auto-filled with generated values)", " add 1:n relationship [as ] from

. to .", " [on delete ] [on update ] [--create-fk]", " drop relationship ", @@ -1223,6 +1225,14 @@ impl App { " show table ", " show data ", "Types: text, int, real, decimal, bool, date, datetime, blob, serial, shortid", + "Auto-generated types (serial, shortid):", + " serial — integer that auto-fills with the next sequence value", + " (MAX(col)+1) on insert. Outside a primary key it carries", + " a UNIQUE contract.", + " shortid — short base58 identifier auto-filled at insert time. Always", + " carries a UNIQUE contract.", + " Adding or changing-to either type on a non-empty table auto-fills", + " existing/null cells in the same operation.", ] { self.note_system(line); } diff --git a/tests/iteration4b_lifecycle_commands.rs b/tests/iteration4b_lifecycle_commands.rs index b5e7c88..6148cc3 100644 --- a/tests/iteration4b_lifecycle_commands.rs +++ b/tests/iteration4b_lifecycle_commands.rs @@ -67,6 +67,36 @@ fn help_command_lists_supported_commands() { } } +#[test] +fn help_describes_auto_generated_type_behaviour() { + // ADR-0017 / ADR-0018: the in-app help must surface the + // auto-fill contract for serial / shortid columns and the + // change-column conversion flags. Captured as a regression + // check so a future help-text edit doesn't silently drop the + // pedagogical lines. + let mut app = App::new(); + type_str(&mut app, "help"); + submit(&mut app); + let body = app + .output + .iter() + .map(|l| l.text.as_str()) + .collect::>() + .join("\n"); + for keyword in [ + "--force-conversion", + "--dont-convert", + "Auto-generated types", + "auto-filled", + "UNIQUE", + ] { + assert!( + body.contains(keyword), + "help output missing `{keyword}`:\n{body}", + ); + } +} + #[test] fn save_on_temp_opens_path_entry_modal() { let mut app = App::new();