Skip to main content

sanitize

Function sanitize 

Source
pub fn sanitize(branch: &str) -> String
Expand description

Sanitize a branch name so it can be used as a KuzuDB table name prefix.

Rules applied (in order):

  • /__ (preserves branch hierarchy visibility)
  • any remaining non-alphanumeric char → _
  • leading digit → prefix with b_ (table names can’t start with a digit)

Examples:

  • mainmain
  • feat/authfeat__auth
  • feat/auth-v2feat__auth_v2
  • release/v1.0release__v1_0