Skip to content

Support for DDL ALTER statement #215

@rmorais01

Description

@rmorais01

Is your feature request related to a problem? Please describe.
A very useful addition to the simple-ddl-parser would be the ability to parse and process the SQL ALTER command for ADD/DROP/RENAME column, MODIFY DATATYPE and MODIFY CONSTRAINT. Currently there is a very limited support for only processing ALTER statements with FOREIGN key.

Describe the solution you'd like
The solution must be able to parse the SQL ALTER command and apply the alterations to the Table created using the CREATE command in the same file.

Describe alternatives you've considered
NA

Additional context
Here are some examples for the ALTER command

ALTER TABLE - ADD Column
ALTER TABLE table_name ADD column_name datatype;

ALTER TABLE - DROP COLUMN
ALTER TABLE table_name DROP COLUMN column_name;

ALTER TABLE - RENAME COLUMN
ALTER TABLE table_name RENAME COLUMN old_name to new_name;

ALTER TABLE - ALTER/MODIFY DATATYPE
ALTER TABLE table_name ALTER COLUMN column_name datatype; (SQL Server)
ALTER TABLE table_name MODIFY COLUMN column_name datatype; (My SQL / Oracle (prior version 10G)
ALTER TABLE table_name MODIFY column_name datatype; (Oracle 10G and later:)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions