WebReflection / dblite

sqlite for node.js without gyp problems
MIT License
209 stars 34 forks source link

Does not handle CTEs (WITH keyword) #51

Closed dataspoon closed 6 years ago

dataspoon commented 6 years ago

dblite does not handle CTEs https://www.sqlite.org/lang_with.html

The verify select method needs to be modified to include WITH|with.

An example of a CTE: WITH test(name) AS ( SELECT "JOHN" ) SELECT name FROM test;

WebReflection commented 6 years ago

you mean here ? https://github.com/WebReflection/dblite/blob/master/src/dblite.js#L45

dataspoon commented 6 years ago

That's the line.

changing it to: SELECT = /^(?:select|SELECT|pragma|PRAGMA|with|WITH) /,

fixes the CTE issue.