Skip to main content

Module naming

Module naming 

Source
Expand description

Convert SQL identifiers to Rust-idiomatic forms.

The primary entry point is singularize, which turns a (potentially snake_case) plural noun into its singular form so that table names like users produce User instead of Users. Rust ORMs (Diesel, SeaORM) and the broader ActiveRecord-style world expect singular row structs.

Functions§

singularize
Singularize a snake_case identifier by transforming only the trailing word: user_accountsuser_account, news_postsnews_post.
singularize_word
Singularize a single English word. Conservative: when in doubt the word is returned unchanged so we never butcher a perfectly good singular noun.