Skip to main content

rewrite_database_names

Function rewrite_database_names 

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

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

Applies suffix-based renaming to all UnresolvedDatabaseName nodes in the given statements using the auto-generated VisitMut traversal. Only identifiers that exactly match database_name are rewritten; string literals, comments, and other identifiers are untouched.

ยงArguments

  • statements - Parsed mod statements to rewrite (mutated in place)
  • database_name - The original database name to match
  • suffix - The suffix to append (e.g., "_dev")