-
-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canned queries with named parameters fail with error against SQLite 3.46.0 #2353
Comments
Code at fault: datasette/datasette/utils/__init__.py Lines 1137 to 1150 in 7437d40
|
The key problem here is that opcodes are not a stable feature of SQLite, so it was always risk to attempt to use them in this way. |
We need to ensure SQLite 3.46.0 is covered in the new tests here: |
Posted about this on the SQLite forum - https://sqlite.org/forum/forumpost/0adbc56447 - but since opcodes are an undocumented and unsupported interface I don't expect them to fix it. |
This mechanism here was already supposed to catch things if SQLite broke the mechanism I was using: datasette/datasette/utils/__init__.py Lines 1149 to 1150 in 7437d40
But it didn't think to catch |
Here's the macOS SQLite 3.46.0 |
Here's the commit that removed this feature: https://sqlite.org/src/info/dd5977c9a8a418be |
I manually tested the patch to 0.64.x like this: DYLD_LIBRARY_PATH=sqlite-3.46.0 datasette fixtures.db -m issue-2353.yaml -p 8034 Then visited http://127.0.0.1:8034/fixtures/demo?table=facetable and it worked. I confirmed that the page had an error before applying that cherry-pick. |
Here's the full set of changes going out in 0.64.7: 0.64.6...0.64.7 |
Blogged about the release here: https://simonwillison.net/2024/Jun/12/datasette-0647/ |
Need to forward-port this to Datasette 1.0. |
Oh it's in Datasette 1.0 already, just not yet in a release: d118d5c |
Reported on Discord: https://discord.com/channels/823971286308356157/823971286941302908/1248924498128932914
I managed to replicate it locally using this trick https://til.simonwillison.net/sqlite/sqlite-version-macos-python
DYLD_LIBRARY_PATH=$PWD datasette fixtures.db -c datasette.yml --pdb
Where
datasette.yml
has this:Then navigate to http://127.0.0.1:8001/fixtures/demo
Within the
--pdb
debugger I could see this:Note that the
Variable
opcode now hasp4
asNone
- and the name of the variable no longer appears in any of the opcodes!The text was updated successfully, but these errors were encountered: