mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-11 06:22:04 +00:00
Add support for Postgres ALTER TYPE
(#1727)
This commit is contained in:
parent
68c41a9d5a
commit
c75a992621
6 changed files with 271 additions and 61 deletions
|
@ -48,13 +48,15 @@ pub use self::dcl::{
|
|||
};
|
||||
pub use self::ddl::{
|
||||
AlterColumnOperation, AlterConnectorOwner, AlterIndexOperation, AlterPolicyOperation,
|
||||
AlterTableOperation, ClusteredBy, ColumnDef, ColumnOption, ColumnOptionDef, ColumnPolicy,
|
||||
ColumnPolicyProperty, ConstraintCharacteristics, CreateConnector, CreateFunction, Deduplicate,
|
||||
DeferrableInitial, DropBehavior, GeneratedAs, GeneratedExpressionMode, IdentityParameters,
|
||||
IdentityProperty, IdentityPropertyFormatKind, IdentityPropertyKind, IdentityPropertyOrder,
|
||||
IndexOption, IndexType, KeyOrIndexDisplay, NullsDistinctOption, Owner, Partition,
|
||||
ProcedureParam, ReferentialAction, TableConstraint, TagsColumnOption,
|
||||
UserDefinedTypeCompositeAttributeDef, UserDefinedTypeRepresentation, ViewColumnDef,
|
||||
AlterTableOperation, AlterType, AlterTypeAddValue, AlterTypeAddValuePosition,
|
||||
AlterTypeOperation, AlterTypeRename, AlterTypeRenameValue, ClusteredBy, ColumnDef,
|
||||
ColumnOption, ColumnOptionDef, ColumnPolicy, ColumnPolicyProperty, ConstraintCharacteristics,
|
||||
CreateConnector, CreateFunction, Deduplicate, DeferrableInitial, DropBehavior, GeneratedAs,
|
||||
GeneratedExpressionMode, IdentityParameters, IdentityProperty, IdentityPropertyFormatKind,
|
||||
IdentityPropertyKind, IdentityPropertyOrder, IndexOption, IndexType, KeyOrIndexDisplay,
|
||||
NullsDistinctOption, Owner, Partition, ProcedureParam, ReferentialAction, TableConstraint,
|
||||
TagsColumnOption, UserDefinedTypeCompositeAttributeDef, UserDefinedTypeRepresentation,
|
||||
ViewColumnDef,
|
||||
};
|
||||
pub use self::dml::{CreateIndex, CreateTable, Delete, Insert};
|
||||
pub use self::operator::{BinaryOperator, UnaryOperator};
|
||||
|
@ -2691,6 +2693,11 @@ pub enum Statement {
|
|||
with_options: Vec<SqlOption>,
|
||||
},
|
||||
/// ```sql
|
||||
/// ALTER TYPE
|
||||
/// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-altertype.html)
|
||||
/// ```
|
||||
AlterType(AlterType),
|
||||
/// ```sql
|
||||
/// ALTER ROLE
|
||||
/// ```
|
||||
AlterRole {
|
||||
|
@ -4438,6 +4445,9 @@ impl fmt::Display for Statement {
|
|||
}
|
||||
write!(f, " AS {query}")
|
||||
}
|
||||
Statement::AlterType(AlterType { name, operation }) => {
|
||||
write!(f, "ALTER TYPE {name} {operation}")
|
||||
}
|
||||
Statement::AlterRole { name, operation } => {
|
||||
write!(f, "ALTER ROLE {name} {operation}")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue