Skip to content

Support sqlite builds with DQS=off#311

Open
knz wants to merge 1 commit intograntjenks:masterfrom
knz:master
Open

Support sqlite builds with DQS=off#311
knz wants to merge 1 commit intograntjenks:masterfrom
knz:master

Conversation

@knz
Copy link

@knz knz commented Apr 3, 2024

If sqlite3 is built with double-quoted string literals disabled (which is recommended, see https://www.sqlite.org/compile.html#dqs), diskcache starts failing with the following crypting error:

no such column: "size" 

This is because the syntax WHERE key = "size" in standard SQL refers to a column named "size", not a string literal. Parsing this as a string literal is a conditional sqlite extension.

This patch makes the code more robust by avoiding this optional sqlite feature.

If sqlite3 is built with double-quoted string literals disabled (which is recommended, see https://www.sqlite.org/compile.html#dqs), diskcache starts failing with the following crypting error: ``` no such column: "size" ``` This is because the syntax `WHERE key = "size"` in standard SQL refers to a column named "size", not a string literal. Parsing this as a string literal is a conditional sqlite extension. This patch makes the code more robust by avoiding this optional sqlite feature.
@knz
Copy link
Author

knz commented Apr 17, 2024

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request May 22, 2024
@atom-andrew
Copy link

sqlite 3.49 (at least 3.49.1 released on conda forge) appears to have (possibly inadvertently) set DQS=off, so this failure has reappeared. I believe sqlite had backed away from changing this setting temporarily and I don't see the change explicitly announced in the changelog, which leads me to think this was inadvertent. Still, it would be nice to have this package be unaffeted.

@JulianEberius
Copy link

We were also bitten by this change in Conda. Agree it would be cool if diskcache would be compatible with dqs=off, since this is advocated by SQLite as the recommended option (see https://www.sqlite.org/quirks.html).

Anything we can do to help get this merged?

@schmoelder
Copy link

Just wanted to chime in and mention that we're also impacted by the conda-forge issue.
While looking into the root cause, I noticed that diskcache development seems to have stalled, with the last commit about a year ago.

I still find it to be a very useful library and would love to keep using it.
I’m just wondering if it has a future or if it might eventually be archived.

@jiffyclub
Copy link

Creating an explicit link over to the related conda-forge issue: conda-forge/sqlite-feedstock#130

jiffyclub added a commit to populus-ai/python-diskcache that referenced this pull request Mar 14, 2025
Diskcache is using double-quoted string literals in SQL queries, which is not supported by all SQL databases. This change replaces double quotes with single quotes in SQL queries. Copied from grantjenks#311
jiffyclub added a commit to populus-ai/python-diskcache that referenced this pull request Mar 14, 2025
Update for sqlite wihout double quoting Diskcache is using double-quoted string literals in SQL queries, which is not supported by all SQL databases. This change replaces double quotes with single quotes in SQL queries. Copied from grantjenks#311
@martinscooper
Copy link

+1

@knz
Copy link
Author

knz commented Jun 10, 2025

@grantjenks are you still working on diskcache?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants