1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
mod cloud; mod local; pub use cloud::{create_cloud_tenant, swap_to_external_host}; pub use local::{create_external_tenant, create_local_tenant}; fn sanitize_database_name(name: &str) -> String { let sanitized: String = name .chars() .map(|c| { if c.is_ascii_alphanumeric() || c == '_' { c } else { '_' } }) .collect(); if sanitized.is_empty() { "systemprompt".to_string() } else if sanitized.chars().next().is_some_and(|c| c.is_ascii_digit()) { format!("db_{}", sanitized) } else { sanitized } }