Skip to main content

rewrite_schema_names

Function rewrite_schema_names 

Source
pub(crate) fn rewrite_schema_names(
    statements: &mut [Statement<Raw>],
    schema_name: &str,
    suffix: &str,
)
Expand description

Rewrite schema names in parsed mod statements by appending a suffix.

Applies suffix-based renaming to all UnresolvedSchemaName nodes in the given statements using the auto-generated VisitMut traversal. Matches the last identifier in each schema name (the schema part), so both schema and db.schema forms are handled.

ยงArguments

  • statements - Parsed mod statements to rewrite (mutated in place)
  • schema_name - The original schema name to match
  • suffix - The suffix to append (e.g., "_staging")