fleet/frontend/utilities/node-sql-parser
Scott Gress e992367e54
Support bitwise operators in SQL editor (#35583)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #34628 

# Details 

This fixes an issue where valid bitwise operators are reject as invalid
syntax in our SQL editor. This fix uses a forked version of the
node-sql-parser library. I've [put a PR up to the upstream
library](https://github.com/taozhi8833998/node-sql-parser/pull/2611),
but there's also another PR that's waiting to be merged (and [another
ticket we need to fix](https://github.com/fleetdm/fleet/issues/34635))
before we can revert to the upstream.

# Checklist for submitter

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

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually
Tested w/ query from original ticket:

<img width="540" height="448" alt="image"
src="https://github.com/user-attachments/assets/0285cdd7-60af-4adb-b562-f33b98937cae"
/>
2025-11-13 10:39:16 -06:00
..
README.md Support bitwise operators in SQL editor (#35583) 2025-11-13 10:39:16 -06:00
sqlite.d.ts Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
sqlite.js Support bitwise operators in SQL editor (#35583) 2025-11-13 10:39:16 -06:00
sqlite.js.map Support bitwise operators in SQL editor (#35583) 2025-11-13 10:39:16 -06:00

About

This is compiled from a fork of the 5.3.13 release of node-sql-parser library. It includes fixes for:

Once a new release of node-sql-parser comes out with this code in it, we can revert back to using node-sql-parser as a dependency in Fleet.

To compile

  1. Check out https://github.com/sgress454/node-sql-parser/tree/5.3.13-plus
  2. npm install
  3. npm run build
  4. cp output/prod/build/sqlite.* /path/to/fleet/frontend/utilities/node-sql-parser