Skip to content

SQLite: Support multi-word type names - #2556

Open
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:sqlite-multiword-type-names
Open

LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:sqlite-multiword-type-names

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

This PR lets SQLiteDialect parse type names made of several words or string literals in column definitions, CAST and ALTER TABLE ... ADD. Column constraints such as NOT NULL, PRIMARY KEY or DEFAULT still end the type name.

CREATE TABLE t (a UNSIGNED BIG INT, b NATIVE CHARACTER(70), c 'text');
SELECT CAST(a AS foo bar) FROM t;
-- Previously: Expected: ',' or ')' after column definition, found: BIG

SQLite accepts any sequence of names as a type, see datatypes.

@LucaCappelletti94 LucaCappelletti94 added enhancement New feature or request fuzzer A bug found by the fuzzer labels Sep 23, 2026
@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review September 23, 2026 13:48
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 92.30769% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.16%. Comparing base (1ba145b) to head (d53faf5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ast/data_type.rs 66.66% 0 Missing and 2 partials ⚠️
src/parser/mod.rs 95.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2556      +/-   ##
==========================================
+ Coverage   81.14%   81.16%   +0.01%     
==========================================
  Files          42       42              
  Lines       33739    33789      +50     
  Branches    33739    33789      +50     
==========================================
+ Hits        27379    27425      +46     
- Misses       2797     2799       +2     
- Partials     3563     3565       +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-multiword-type-names branch from d8b910a to 295fab0 Compare October 2, 2026 16:14
@LucaCappelletti94
LucaCappelletti94 force-pushed the sqlite-multiword-type-names branch from 295fab0 to d53faf5 Compare October 2, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request fuzzer A bug found by the fuzzer SQLite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants