systemprompt_cli/commands/cloud/tenant/create/
mod.rs1mod local;
10
11pub use local::{create_external_tenant, create_local_tenant};
12
13fn sanitize_database_name(name: &str) -> String {
14 let sanitized: String = name
15 .chars()
16 .map(|c| {
17 if c.is_ascii_alphanumeric() || c == '_' {
18 c
19 } else {
20 '_'
21 }
22 })
23 .collect();
24
25 if sanitized.is_empty() {
26 "systemprompt".to_owned()
27 } else if sanitized.chars().next().is_some_and(|c| c.is_ascii_digit()) {
28 format!("db_{}", sanitized)
29 } else {
30 sanitized
31 }
32}