Modules§
Structs§
- Generated
File - A generated code file with its content and required imports.
Functions§
- build_
module_ name - Build a module name, prefixing with schema only when the name collides (same table name exists in multiple schemas).
- detect_
tab_ spaces - Detect
tab_spacesfromrustfmt.tomlor.rustfmt.tomlby walking up fromstart_dir. Returns 4 (rustfmt default) if no config is found. - format_
tokens_ with_ imports - format_
tokens_ with_ imports_ and_ tab_ spaces - generate
- Generate all code for a given schema.
- generate_
with_ domain_ style - Same as
generatebut lets the caller pick how Postgres domains are rendered (alias vs newtype). - imports_
for_ derives - Returns the imports needed for well-known extra derives.
- is_
default_ schema - Returns true if the schema is a well-known default (public, main, dbo).
- is_
rust_ keyword - Returns true if the given name is a Rust reserved keyword.
- normalize_
module_ name - Normalize a table name for use as a Rust module/filename: replace multiple consecutive underscores with a single one.
- required_
pg_ search_ path - Compute the schemas that must appear in PostgreSQL’s
search_pathfor the generated code to resolve every emitted unqualifiedtype_name. - rust_
type_ name_ for - Compute the Rust identifier for an enum / composite / domain.
- type_
name_ has_ cross_ schema_ collision - True when the SQL
nameis declared by enums / composites / domains living in more than one schema.