client/show-privs: allow showing single char hints in table output
All checks were successful
Build and test / check (push) Successful in 1m44s
Build and test / build (push) Successful in 3m24s
Build and test / test (push) Successful in 3m28s
Build and test / check-license (push) Successful in 4m54s
Build and test / docs (push) Successful in 6m43s

This commit is contained in:
2025-12-14 15:58:02 +09:00
parent 56596835fa
commit 7b79f7b163
3 changed files with 41 additions and 3 deletions

View File

@@ -101,3 +101,22 @@ pub fn db_priv_field_human_readable_name(name: &str) -> String {
_ => format!("Unknown({})", name),
}
}
/// Converts a database privilege field name to a single-character name.
/// (the characters from the cli privilege editor)
pub fn db_priv_field_single_character_name(name: &str) -> &str {
match name {
"select_priv" => "s",
"insert_priv" => "i",
"update_priv" => "u",
"delete_priv" => "d",
"create_priv" => "c",
"drop_priv" => "D",
"alter_priv" => "a",
"index_priv" => "I",
"create_tmp_table_priv" => "t",
"lock_tables_priv" => "l",
"references_priv" => "r",
_ => "?",
}
}