Skip to content

Parse SQLite's IS and IS NOT operators - #2470

Open
LucaCappelletti94 wants to merge 4 commits into
apache:mainfrom
LucaCappelletti94:sqlite-is-operator
Open

LucaCappelletti94 wants to merge 4 commits into
apache:mainfrom
LucaCappelletti94:sqlite-is-operator

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

This PR adds support for SQLite accepts IS and IS NOT between arbitrary expressions. Only SQLite supports them, as far as I can tell.

@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review August 31, 2026 13:28
LucaCappelletti94 added a commit to LucaCappelletti94/sqlparser-rs that referenced this pull request Oct 1, 2026
@codecov-commenter

codecov-commenter commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.24%. Comparing base (dcbc923) to head (2d8ba04).

Files with missing lines Patch % Lines
src/parser/mod.rs 93.10% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2470   +/-   ##
=======================================
  Coverage   81.23%   81.24%           
=======================================
  Files          42       42           
  Lines       33891    33919   +28     
  Branches    33891    33919   +28     
=======================================
+ Hits        27533    27559   +26     
  Misses       2793     2793           
- Partials     3565     3567    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

LucaCappelletti94 added a commit to LucaCappelletti94/sqlparser-rs that referenced this pull request Oct 1, 2026
LucaCappelletti94 added a commit to LucaCappelletti94/sqlparser-rs that referenced this pull request Oct 2, 2026
LucaCappelletti94 added a commit to LucaCappelletti94/sqlparser-rs that referenced this pull request Oct 2, 2026
@LucaCappelletti94
LucaCappelletti94 force-pushed the sqlite-is-operator branch 2 times, most recently from 56279d2 to 437a771 Compare October 3, 2026 06:35
@LucaCappelletti94 LucaCappelletti94 added enhancement New feature or request waiting on reviewer PR needs to be reviewed labels Oct 16, 2026

@sabir-akhadov-localstack sabir-akhadov-localstack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One non-blocking comment inline.

Comment thread src/parser/mod.rs Outdated
BinaryOperator::Is
};
// SQLite parses `IS` at the same left-associative level as the
// comparison operators, see <https://www.sqlite.org/syntax/expr.html>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SQLite puts < <= > >= one level above =/IS (lang_expr.html, operator table), so a IS b < c is a IS (b < c) there while this yields (a IS b) < c; sqlite 3.46: SELECT 0 IS 1 < 2 -> 0. Same pre-existing lumping the crate does for a = b < c, so fine to leave, but the comment could say "same level as =" and link lang_expr.html rather than syntax/expr.html, which has no precedence info.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The comment describes IS and IS NOT at the same precedence level as = and links SQLite’s operator table. The preexisting comparison-precedence limitation is handled separately in #2678.

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

Labels

enhancement New feature or request SQLite waiting on reviewer PR needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants