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

Add Optional NOT to function expression #639

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

griffio
Copy link
Contributor

@griffio griffio commented Aug 5, 2024

fixes #638

This allows boolean functions to be negated

More useful for ANSI SQL aggregate function every (though not supported by Sqlite)

SELECT
  column1,
  column2,
  COUNT(*) AS count
FROM
  table_name
GROUP BY
  column1,
  column2
HAVING
  NOT every(column1 IS NOT NULL);

This could be fixed in the PostgreSql dialect, as there are more uses for boolean functions, but is applicable to all dialects

This allows boolean functions to be negated
More useful for ANSI SQL  aggregate  function `every`

SELECT
  column1,
  column2,
  COUNT(*) AS count
FROM
  table_name
GROUP BY
  column1,
  column2
HAVING
  NOT every(column1 IS NOT NULL);
@AlecKazakova AlecKazakova merged commit 2e91f45 into sqldelight:master Aug 6, 2024
1 check passed
@AlecKazakova
Copy link
Collaborator

thank you!

@griffio griffio deleted the fix-638-not-function-expr branch August 6, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NOT should be able to negate function expressions that return Boolean
2 participants