-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
In standard sql single quotes are for values and double quotes are for identities like column names. Although sqlite does support double quote values this seems to have changed in 3.41.0.
I have sqlite 3.41.0 installed and when this extension uses it, I get the following error when I try to open a database:
[12:12:12 AM][vscode-sqlite][ERROR] Failed to open database '...\database.db': Parse error near line 4: no such column: table
aster WHERE (type="table" OR type="view")
error here ---^
I was able to track down the query:
vscode-sqlite/src/sqlite/schema.ts
Lines 46 to 50 in c09e348
| const tablesQuery = `SELECT name, type FROM sqlite_master | |
| WHERE (type="table" OR type="view") | |
| AND name <> 'sqlite_sequence' | |
| AND name <> 'sqlite_stat1' | |
| ORDER BY type ASC, name ASC;`; |
If one tries to run that query on an empty sqlite database in the cli, we get a similar error
>sqlite3
SQLite version 3.41.0 2023-02-21 18:09:37
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> SELECT name, type FROM sqlite_master
...> WHERE (type="table" OR type="view")
...> AND name <> 'sqlite_sequence'
...> AND name <> 'sqlite_stat1'
...> ORDER BY type ASC, name ASC;
Parse error: no such column: table
SELECT name, type FROM sqlite_master WHERE (type="table" OR type="view") AND n
error here ---^
sqlite>
The workaround is to pin the sqlite client to the one included with the extension. Set the vscode setting
sqlite.sqlite3 to the correct client in .vscode\extensions\alexcvzz.vscode-sqlite-0.14.1\bin
smargoli2, PabloPerugino, HeinzRuetschi, b01x, walkersa and 10 moreVianpyro, DowneyX, spking11, ctrlmed, markdall and 11 more
Metadata
Metadata
Assignees
Labels
No labels