Skip to main content

qualify_relation_table

Function qualify_relation_table 

Source
pub fn qualify_relation_table(caller_table: &str, target_table: &str) -> String
Expand description

Qualify a relation target table with the calling entity’s schema.

EntityRepoMeta::relations() emits bare table names (e.g. countries), but module tables live in the module’s own schema (geo.countries) and the runtime app role’s search_path does not include module schemas — an unqualified reference fails with “relation does not exist”. The calling entity’s table name is schema-qualified, so its prefix is the schema a relation declared inside one module shares with its target. Targets that already carry a schema, and callers that do not, pass through unchanged.