fleet/frontend/utilities/node-sql-parser
Scott Gress 0a4d03f20e
Allow string concat in LIKE op in query editor (#32254)
for #30854 

# Details

This PR updates our SQL query parser to allow string concatenation
inside of LIKE expressions, e.g.

```sql
SELECT * FROM file WHERE path LIKE 'C:' || CHAR(92) || 'Users' || CHAR(92) || 'example.txt';
```

See https://github.com/sgress454/node-sql-parser/pull/1/files for the
code changes in the parser, which are packaged into the changes in this
PR using the instructions
[here](https://github.com/fleetdm/fleet/blob/sgress454/30854-allow-concat-in-like/frontend/utilities/node-sql-parser/README.md#L12).

PR to upstream package:
https://github.com/taozhi8833998/node-sql-parser/pull/2552

# 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
(in upstream repo)

- [X] QA'd all new/changed functionality manually
2025-08-26 14:08:49 -05:00
..
README.md Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
sqlite.d.ts Allow ESCAPE in LIKE clauses to be valid SQL (#31222) 2025-07-25 10:13:55 -05:00
sqlite.js Allow string concat in LIKE op in query editor (#32254) 2025-08-26 14:08:49 -05:00
sqlite.js.map Allow string concat in LIKE op in query editor (#32254) 2025-08-26 14:08:49 -05:00

About

This is compiled from a fork of the 5.3.10 release of node-sql-parser library created to fix issue #30109.

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.10-plus
  2. npm install
  3. npm run build
  4. cp output/prod/build/sqlite.* /path/to/fleet/frontend/utilities/node-sql-parser