Zaid-Ajaj / Npgsql.FSharp.Analyzer

F# analyzer that provides embedded SQL syntax analysis, type-checking for parameters and result sets and nullable column detection when writing queries using Npgsql.FSharp.
MIT License
137 stars 9 forks source link

Add support for quoted identifiers #28

Closed dbrattli closed 3 years ago

dbrattli commented 3 years ago

Proposed Changes

Add support for quoted identifiers (https://www.postgresql.org/docs/13/sql-syntax-lexical.html). Also make sure identifiers are not reserved keywords. Currently the parser would except invalid SQL e.g:

SELECT * FROM FROM

With this PR you would need to use a quoted identifier, and quoted identifiers are also parsed correctly (previously they would be ignored):

SELECT * FROM "FROM"

Types of changes

What types of changes does your code introduce to BinaryDefense.FSharp.Analyzers? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

dbrattli commented 3 years ago

Some whitespace removed 😬 . If it's a problem I can revert it.