joereynolds / joereynolds/sql-lint

linter is parsing keywords within strings

Open
#233 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
459
Forks
44
PR merge metrics
No merged PRs in 30d

Description

The linter should ignore keywords inside properly quoted strings, here it's found the word `limit` inside a string which should not be invalid.
```js
const sqlLint = require('sql-lint').default;

const main = async function (sqlQuery) {
const SQLerrors = await sqlLint({ driver: "postgres", sql: sqlQuery });
console.log(SQLerrors);
}

main("INSERT INTO my_table (notes) VALUES ('speed limit sign');")
```

returns:
```json
[
{
source: '',
error: "[sql-lint: invalid-limit-quantifier] Argument 'sign' is not a valid quantifier for LIMIT clause.",
line: 1,
additionalInformation: ''
}
]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.