Skip to content

SQLite: Support IN with a table name or table-valued function - #2680

Open
LucaCappelletti94 wants to merge 4 commits into
in-expr-refactorfrom
sqlite-in-table
Open

LucaCappelletti94 wants to merge 4 commits into
in-expr-refactorfrom
sqlite-in-table

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

Stacked on the IN refactor PR.

In SQLite "the right-hand side of an IN or NOT IN operator can be a table name or table-valued function name in which case the right-hand side is understood to be a subquery of the form (SELECT * FROM name)" (https://www.sqlite.org/lang_expr.html#in_op). SQLite 3.51.1 runs SELECT 1 IN t, SELECT 1 NOT IN t and SELECT 1 IN main.t, but the SQLite dialect failed with Expected: (, found: t.

InTarget gains a Table { name, args } variant, and a new dialect method, supports_in_table_expression, enables it for SQLite and the generic dialect. It does not apply to ClickHouse's GLOBAL IN. Tests round-trip plain, qualified and function forms with and without NOT, check the parsed name and arguments, and check that parenthesized lists and subqueries still parse as before.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.09524% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.40%. Comparing base (5d8f8d5) to head (2aba89a).

Files with missing lines Patch % Lines
src/parser/mod.rs 70.00% 0 Missing and 3 partials ⚠️
src/ast/mod.rs 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           in-expr-refactor    #2680      +/-   ##
====================================================
+ Coverage             81.33%   81.40%   +0.07%     
====================================================
  Files                    42       42              
  Lines                 33957    33999      +42     
  Branches              33957    33999      +42     
====================================================
+ Hits                  27618    27676      +58     
+ Misses                 2775     2752      -23     
- Partials               3564     3571       +7     

☔ 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
LucaCappelletti94 marked this pull request as ready for review October 18, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants