fmguerreiro opened a new pull request, #2311: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2311
## Summary Adds PostgreSQL grammar for five DDL variants that previously failed to parse: - **ALTER TABLE t SET TABLESPACE ts** and **ALTER INDEX idx SET TABLESPACE ts** — extends `AlterTableOperation` and `AlterIndexOperation` with a `SetTablespace` variant (pgmold-109, pgmold-110) - **ALTER DOMAIN d ADD CONSTRAINT / DROP CONSTRAINT** — new `AlterDomain` statement with `AlterDomainOperation` enum covering ADD/DROP CONSTRAINT, RENAME CONSTRAINT, RENAME TO, OWNER TO, SET SCHEMA, SET DEFAULT, DROP DEFAULT, VALIDATE CONSTRAINT (pgmold-113) - **ALTER TRIGGER name ON table RENAME TO new_name** — new `AlterTrigger` statement (pgmold-124) - **ALTER EXTENSION ext UPDATE [TO version]** — new `AlterExtension` statement with UPDATE TO, SET SCHEMA, OWNER TO, RENAME TO operations (pgmold-126) - **ALTER PROCEDURE name(args) action** — extends `AlterFunctionKind` with a `Procedure` variant, reusing the existing `AlterFunction` machinery (pgmold-130) ## Changes - `src/ast/ddl.rs`: new structs `AlterDomain`, `AlterDomainOperation`, `AlterTrigger`, `AlterTriggerOperation`, `AlterExtension`, `AlterExtensionOperation`; extends `AlterTableOperation`, `AlterIndexOperation`, `AlterFunctionKind` - `src/ast/mod.rs`: adds `Statement::AlterDomain`, `Statement::AlterExtension`, `Statement::AlterTrigger` variants; updates re-exports and Display match - `src/ast/spans.rs`: exhaustive arms for new Statement variants and operations - `src/parser/mod.rs`: extends `parse_alter` dispatch; adds `parse_alter_domain`, `parse_alter_trigger`, `parse_alter_extension`; wires `PROCEDURE` to `parse_alter_function(AlterFunctionKind::Procedure)` - `tests/sqlparser_postgres.rs`: round-trip tests for all five variants Note: fork CI does not run automatically on this repo — correctness is validated by the inline tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
