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

Set "PRIMARY" as a reserved keyword for index names #960

Merged
merged 5 commits into from
Oct 20, 2022

Conversation

devgony
Copy link
Collaborator

@devgony devgony commented Oct 19, 2022

Goal

At #935 , I missed a few edge cases like,

  1. dropping index named as PRIMARY
DROP INDEX Bar.PRIMARY;

=> should get cannot drop primary index error

  1. creating index named as PRIMARY
CREATE INDEX Primary ON Foo (id);

=> should get cannot create index with reserved name "Primary" error

Todo

  • test: add cases for DROP and CREATE PRIMARY
  • feat: implement cannot drop primary
  • feat: implement cannot create index named as PRIMARY

Next

  • Implement Primary key with physical index
  • It is expected to drop and create primary index manually in future.

@devgony devgony added the bug Something isn't working label Oct 19, 2022
@devgony devgony requested review from panarch and ever0de October 19, 2022 12:15
@devgony devgony self-assigned this Oct 19, 2022
@coveralls
Copy link

coveralls commented Oct 19, 2022

Pull Request Test Coverage Report for Build 3290512823

  • 23 of 23 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 97.877%

Totals Coverage Status
Change from base Build 3279870115: 0.08%
Covered Lines: 38075
Relevant Lines: 38901

💛 - Coveralls

Copy link
Member

@panarch panarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all good! Thanks a lot 👍 👍

@panarch panarch merged commit 29e9bd2 into gluesql:main Oct 20, 2022
@panarch panarch changed the title fix: handle Error when DROP and CREATE PRIMARY INDEX manually Set "PRIMARY" as a reserved keyword for index names Oct 20, 2022
devgony added a commit to devgony/gluesql that referenced this pull request Oct 29, 2022
Set "PRIMARY" as a reserved keyword for index names.
Block use of "PRIMARY" name in create or drop index queries.
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants