Expand description
Naming conventions shared across generators.
Centralised so every crate agrees on how a model name maps to a module name, a table name, etc. Kept dependency-free (no heavy inflection crate) for the MVP.
Functions§
- model_
name - Recover a model’s
PascalCasestruct name from its module/table name:users->User,blog_posts->BlogPost. - pascal_
case - Convert a
snake_caseidentifier back toPascalCase:blog_post->BlogPost. - pluralize
- Naive pluralisation good enough for table names in the MVP.
- singularize
- Singularize a table name, inverting
pluralizefor the forms Gize produces:users->user,categories->category,boxes->box. - snake_
case - Convert a
PascalCaseor arbitrary identifier tosnake_case. - table_
name - The table name for a model (snake_case + pluralized):
User->users.