Expand description
The naming convention: how a declaration becomes a physical name.
Applied during lowering, once, so no downstream crate ever re-derives a table
or column name. @map / @@map override everything here.
The pluraliser is deliberately dumb. English is not tractable, and a clever
implementation would be wrong in unpredictable places; a documented, boring one
is wrong in predictable places, and @@map("...") is the escape hatch.
Functionsยง
- column_
name - The column name for a field with no
@map. - enum_
type_ name - The database type name for an enum with no
@@map. - foreign_
key_ name - The derived name of a foreign key constraint over
columnsontable. - index_
name - The derived name of an index over
columnsontable. - is_
rust_ keyword - Whether a field name needs
r#escaping in generated Rust. - pluralize
- Pluralises a lowercase English noun.
- snake_
case - Converts
PascalCaseorcamelCasetosnake_case. - table_
name - The table name for a model with no
@@map. - unique_
name - The derived name of a unique constraint over
columnsontable.