Closed avinassh closed 1 year ago
What version of sqld are you using? foreing_keys should be supported.
journal_mode is not supported at the moment and probably won't be in the near future.
What version of sqld are you using? foreing_keys should be supported.
oops, I should have mentioned I am using Turso, not sqld
What version of sqld are you using? foreing_keys should be supported.
oops, I should have mentioned I am using Turso, not sqld
Try creating a new db of db upgrade you old one. foreing_keys
should work. If they don't then it's a bug.
I upgraded my db and also, created a new one. It didn't work in both cases. I am using Turso CLI (v0.56.0 -- the latest on homebrew)
$ turso db create mario
$ turso db show mario
Name: mario
URL: libsql://mario-avinassh.turso.io
ID: ccd12a52-f0c1-11ed-8b81-668771a97ddc
Locations: maa
Database Instances:
NAME TYPE LOCATION VERSION URL
enabling-american-eagle primary maa The `Basic` HTTP authentication scheme is not allowed libsql://3d8dd64be49789-mario-avinassh.turso.io
$ turso db shell mario
Connected to mario at libsql://mario-avinassh.turso.io
Welcome to Turso SQL shell!
Type ".quit" to exit the shell, ".tables" to list all tables, and ".schema" to show table schemas.
→ PRAGMA foreign_keys = OFF;
Error: Failed to execute SQL statement: PRAGMA foreign_keys = OFF;
unsupported statement
(not sure why the HTTP auth error)
Also I just realised I am asking Turso specific error here. Please let me know should I close this and ask in discord support forums
Looks like the problem is in sqld. The query analyzer has a typo in the names of the pragmas it allows:
It should be "foreign_keys".
Thanks @CodingDoug. Great catch. And thanks @avinassh for finding that out.
I was playing with Python client and I learned that pragma statements are not working. Same with Go client or the Turso CLI:
I got the error: