Databases
sql.model.naming
import sql.model.naming
Zuri
sqllifts part of this module out to its own top level; each name below is shown with the path that reaches it. Anything still spelledsql.model.naming.*needsimport sql.model.naming.
The names that a model uses when it doesn't specify its own.
A model's table name is its class name in snake case, made plural with
the regular rules of English: Post becomes posts, BlogPost becomes
blog_posts, Category becomes categories and Address becomes
addresses. For a word with an irregular plural, such as Person and
people, give the table name with model.table().
Functions
snake()
sql.model.naming.snake(name: string) -> string
ZuriA class name in snake case: BlogPost is blog_post, HTTPRequest is
http_request, and a name in snake case already stays as it is.
Parameters
name(string)
Returns string
plural()
sql.model.naming.plural(word: string) -> string
ZuriA word made plural by the regular rules. Words ending in s, x, z,
ch and sh add es, a y after a consonant becomes ies, and
everything else adds s. Only the last word of a snake case name
changes.
Parameters
word(string)
Returns string
table_for()
sql.model.table_for(name: string) -> string
ZuriThe table a class of this name maps to: plural(snake(name)).
Parameters
name(string)
Returns string
key_for()
sql.model.naming.key_for(name: string) -> string
ZuriThe column another table refers to this class's rows by: its snake case
name and _id, as author_id refers to an Author.
Parameters
name(string)
Returns string
join_table_for()
sql.model.naming.join_table_for(first: string, second: string) -> string
ZuriThe table joining two classes in a many-to-many association: their snake
case names in alphabetical order, joined by an underscore, as post_tag
joins Post and Tag.
Parameters
first(string)second(string)
Returns string
2026, Richard Ore and Zuri contributors