uqa_sql/ast/
type_lifecycle.rs1use serde::{Deserialize, Serialize};
10
11use super::RoleSpecification;
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
15pub enum TypeObjectKind {
16 Type,
17 Domain,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
22pub struct CommentType {
23 pub kind: TypeObjectKind,
24 pub name: String,
25 pub description: Option<String>,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct AlterTypeObject {
31 pub kind: TypeObjectKind,
32 pub name: String,
34 pub action: AlterTypeObjectAction,
35}
36
37#[derive(Debug, Clone, Serialize, Deserialize)]
38pub enum AlterTypeObjectAction {
39 RenameTo(String),
41 SetSchema(String),
43 OwnerTo(RoleSpecification),
44 RenameAttribute {
46 from: String,
47 to: String,
48 },
49 AddAttributes(Vec<super::CompositeAttributeAddition>),
51 AlterAttributes {
53 removals: Vec<super::CompositeAttributeRemoval>,
54 #[serde(default)]
55 type_changes: Vec<super::CompositeAttributeDefinition>,
56 additions: Vec<super::CompositeAttributeAddition>,
57 },
58}