Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ALTER TABLE to operate on columns without COLUMN keyword #145

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Aug 6, 2024

This PR adds support for the following valid ALTER TABLE syntax:

ALTER TABLE <table-name> ADD <column-name> <data-type>;

and

ALTER TABLE <table-name> DROP <column-name>;

Prior to this PR, these queries do not work and result in error conditions.

For reference, here is the documented SQLite syntax for ALTER TABLE queries:
https://www.sqlite.org/syntax/alter-table-stmt.html

It shows that the COLUMN keyword is optional, and I've successfully tested syntax without the COLUMN keyword in both MySQL and SQLite.

Reported by @JanJakes

@brandonpayton brandonpayton added the bug Something isn't working label Aug 6, 2024
@brandonpayton brandonpayton self-assigned this Aug 6, 2024
@bgrgicak bgrgicak merged commit 2561000 into develop Aug 7, 2024
9 checks passed
@bgrgicak bgrgicak deleted the fix-alter-table-add-column branch August 7, 2024 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants