TylerBrinks / SqlParser-cs

A Friendly SQL Parser for .NET
MIT License
108 stars 19 forks source link

Bugfix: where dialect permits identifiers to be single-quoted, ColumDefinitions are properly recognised #33

Closed julescmay closed 2 months ago

julescmay commented 2 months ago

In SQLite (and others that permit single-quoted identifiers):

create table 'test'('id' integer)

failed at 'id'. Although single-quoted tokens are treated tolerantly in ParseIdentifierWithClause(), only properly-formed Words were recognised in ParseColumns(). (As far as I can tell, all other uses parse correctly.)

julescmay commented 2 months ago

Initially I tried adding single-quoted words to SQLiteDialect, but I abandoned that. I don't think it's reasonable to allow single-quoted Words (like double-quoted Words) because we still need single-quotes for strings. So, although this fix feels like a kink, it seems the right solution.