Line data Source code
1 0 : #[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
2 : #[serde(rename_all = "UPPERCASE")]
3 : pub enum Privilege {
4 : Select,
5 : Insert,
6 : Update,
7 : Delete,
8 : Truncate,
9 : References,
10 : Trigger,
11 : Usage,
12 : Create,
13 : Connect,
14 : Temporary,
15 : Execute,
16 : }
17 :
18 : impl Privilege {
19 0 : pub fn as_str(&self) -> &'static str {
20 0 : match self {
21 0 : Privilege::Select => "SELECT",
22 0 : Privilege::Insert => "INSERT",
23 0 : Privilege::Update => "UPDATE",
24 0 : Privilege::Delete => "DELETE",
25 0 : Privilege::Truncate => "TRUNCATE",
26 0 : Privilege::References => "REFERENCES",
27 0 : Privilege::Trigger => "TRIGGER",
28 0 : Privilege::Usage => "USAGE",
29 0 : Privilege::Create => "CREATE",
30 0 : Privilege::Connect => "CONNECT",
31 0 : Privilege::Temporary => "TEMPORARY",
32 0 : Privilege::Execute => "EXECUTE",
33 : }
34 0 : }
35 : }
|