Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot use NOT on BOOLEAN column #3499

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

Closed
kevincianfarini opened this issue Sep 11, 2022 · 0 comments · Fixed by #3504
Closed

Cannot use NOT on BOOLEAN column #3499

kevincianfarini opened this issue Sep 11, 2022 · 0 comments · Fixed by #3504
Labels

Comments

@kevincianfarini
Copy link
Collaborator

SQLDelight Version

2.0.0-alpha03

SQLDelight Dialect

PostgreSQL

Describe the Bug

The NOT operator should be available on boolean columns of a table. For example, the following should be valid.

CREATE TABLE event(
  synced BOOLEAN NOT NULL DEFAULT FALSE
);

invert: 
SELECT * FROM event
WHERE NOT synced;

Right now, the SQLDelight compiler complains that NOT expects EXISTS.

/home/kevin/code/hoa-webhook/event/src/main/sqldelight/org/climatechangemakers/hoa/event/database/HourOfActionEvent.sq: (23, 10): EXISTS expected, got 'synced'
22    SELECT secret FROM hour_of_action_event
23    WHERE NOT synced AND event_start < :today
                ^^^^^^

Stacktrace

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant