-
Notifications
You must be signed in to change notification settings - Fork 252
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 for variable whitespace in “CHECK” enum constraints #289
base: master
Are you sure you want to change the base?
Conversation
Allow for spaces between enum options
for more information, see https://pre-commit.ci
I don't think the changes you made do what you think they do. |
Basically all your changes do is allow any amount of whitespace before and after the |
Tired Thursday apologies. Yes, this PR allows for multiple spaces before the check keyword and any amount of white space (including 0) after the check keyword but before the in keyword. |
Just what kind of CHECK constraint did you have a problem with that wouldn't work with the existing code? I have a hard time understanding. |
My constraint was “CHECK IN('a', 'b', 'c')”, notice the lack of spaces after the IN |
I thought the RDBMS would normalize these. What RDBMS was this on? |
Admittedly, this was an oversight when I uploaded the schema but it was
recognized as valid sql (and worked as a constraint) in SQLite and SQL
Server.
…On Thu, Sep 28, 2023 at 7:05 PM Alex Grönholm ***@***.***> wrote:
Just what kind of CHECK constraint did you have a problem with that
wouldn't work with the existing code? I have a hard time understanding.
—
Reply to this email directly, view it on GitHub
<#289 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD64FZXYZTSDAKUSVINLJ5TX4X7DRANCNFSM6AAAAAA5LUC6DY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ah, that answers my question. I guess it's only PostgreSQL that normalizes those then. |
I will need an accompanying test to ensure that the PR fixes what it says it fixes (and won't break in the future). Meanwhile I'll experiment with sqlite (I don't know how to operate SQL Server). |
Yea, not only that but SQLite returns back the comment associated with the
constraint (rip).
I didn’t check if this was the case for sql server.
…On Thu, Sep 28, 2023 at 7:14 PM Alex Grönholm ***@***.***> wrote:
Ah, that answers my question. I guess it's only PostgreSQL that normalizes
those then.
—
Reply to this email directly, view it on GitHub
<#289 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD64FZRLMFKW6LU5BDXQLZ3X4YAGFANCNFSM6AAAAAA5LUC6DY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
allow for multiple spaces before the check keyword and any amount of white space (including 0) after the check keyword but before the in keyword:
For example, if your constraints was
CHECK IN('a', 'b', 'c')
, this would not be recognized.