Open SanderVocke opened 4 years ago
Adding to this, I've seen the same behavior for the column names "query" and "matrix".
Sorry to spam this. But I learned now that this would work if those literals were escaped using backquotes. Could the parser or SQLite attach function be somehow fixed to escape these literals?
As you said, you will need to use
`...`
or
[...]
to escape the keywords. PR welcome to fix this.
Feel free to keep this closed if you disagree, but I do see it as an issue in the built-in SQLite importer, where users of AlaSQL have no way to modify the table creation queries to add these characters.
It should be possible to fix the SQLite importer without having to support unescaped literals in general.
I noticed this when trying to attach to an SQLite database that has a TEXT column named value. It seems this is seen as some kind of keyword by the parser, even though in this context it is just a string literal.
The following command produces a SyntaxError regardless of the type of database used:
CREATE TABLE table(thing TEXT, value TEXT)
It seems this has been an issue (and solved) before in #246, but may have regressed. I don't know how to work around it in the use-case of importing an external database that already has this column in it.
Error: