Skip to content

Use forked node-sql-parser, fix CTE issues in parsed SQL#38744

Merged
sgress454 merged 6 commits intomainfrom
sgress454/34635
Jan 28, 2026
Merged

Use forked node-sql-parser, fix CTE issues in parsed SQL#38744
sgress454 merged 6 commits intomainfrom
sgress454/34635

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

@sgress454 sgress454 commented Jan 24, 2026

Related issue: Resolves #34635

Details

This PR switches us to a fork of node-sql-parser that I'm maintaining to fast-track fixes to the SQLite implementation. The first published version of the fork is 5.4.0-fork.1 (forked from v5.4.0 of the upstream), and includes fixes for #34635 and #30109 that haven't made it to the upstream yet.

Fixes in 5.4.0-fork.1:

Checklist for submitter

If some of the following don't apply, delete the relevant line.

  • Changes file added for user-visible changes in changes/, orbit/changes/ or ee/fleetd-chrome/changes.
    See Changes files for more information.

Testing

  • Added/updated automated tests
  • Granular tests are added in the package itself, and new regression tests for the Fleet issues are added in the Fleet.
  • QA'd all new/changed functionality manually
  • Pasted the offending queries into the editor and saw no syntax errors

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.06%. Comparing base (db2168f) to head (db36fc3).
⚠️ Report is 116 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #38744      +/-   ##
==========================================
- Coverage   66.07%   66.06%   -0.02%     
==========================================
  Files        2414     2414              
  Lines      192683   192722      +39     
  Branches     8424     8550     +126     
==========================================
+ Hits       127321   127327       +6     
- Misses      53799    53832      +33     
  Partials    11563    11563              
Flag Coverage Δ
frontend 54.17% <ø> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Added tests for the specific queries mentioned in issues. These will act as regression tests as new patches are made to the node-sql-parser package.

@sgress454 sgress454 marked this pull request as ready for review January 27, 2026 16:39
@sgress454 sgress454 requested a review from a team as a code owner January 27, 2026 16:39
@@ -1,5 +1,5 @@
// @ts-ignore
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.

nit: we could also add an alias for this in tsconfig.json (the same way you did on the webpack.config.js) and remove this ts-ignore directive:

"paths": {
      "node-sql-parser": ["../node_modules/@sgress454/node-sql-parser"]
}

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.

great idea! done.

juan-fdz-hawa
juan-fdz-hawa previously approved these changes Jan 28, 2026
@sgress454 sgress454 merged commit efe266b into main Jan 28, 2026
17 checks passed
@sgress454 sgress454 deleted the sgress454/34635 branch January 28, 2026 22:08
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.

Fleet UI rejects valid query https://fleetdm.com/queries/get-mcp-client-configurations

4 participants