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
27
28
29
30
31
32
33
34
35
36
37
38
//
// Unified Query Algebra
//
// Copyright (c) 2023-2026 Cognica, Inc.
//
//! `ALTER TYPE | DOMAIN ... RENAME TO | SET SCHEMA | OWNER TO`.
use serde::{Deserialize, Serialize};
use super::RoleSpecification;
/// The keyword that named the target. `DOMAIN` statements reject types that are not domains.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum TypeObjectKind {
Type,
Domain,
}
/// One `ALTER TYPE` or `ALTER DOMAIN` lifecycle change of a user-defined type and its generated array type.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AlterTypeObject {
pub kind: TypeObjectKind,
/// Rendered, possibly qualified type name as written.
pub name: String,
pub action: AlterTypeObjectAction,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum AlterTypeObjectAction {
/// The new unqualified name.
RenameTo(String),
/// The destination schema.
SetSchema(String),
OwnerTo(RoleSpecification),
/// Append attributes to a standalone composite relation in written order.
AddAttributes(Vec<super::CompositeAttributeAddition>),
}