Is there a way to upgrade SQLite?

For Workes & Pages, what is the name of the domain?

n/a

What is the issue or error you’re encountering

I want to be able to upgrade SQLite to the latest verison so that I can make use of new features. Currently it seems that D1 is on SQLite 3.41.0 which is over a year old (2023-02-21).

Hi there ‘jasperdunn93’,

As I am not comfortable with Cloudflare D1, please have a look on our related documentation to check on your inquiry:

I hope it does help.

Cheers!

Thanks for responding to my query, unfortunately there doesn’t appear to be anything in the documentation about upgrading SQLite.

How are you able to get what SQLite version D1 is currently using or what version your D1 db is using? It is good info to know. I can find nothing in this forum or the docs. I can find no wrangler d1 commands that give that info. Thanks.

I think you can use

sqlite3 -version path/to/dbfile

I used this query:

SELECT sqlite_version();

You have to be careful which SQLite library is being used by the commands and query statements asking for the version.
The only way to ensure it is the CF SQLite D1 being asked is to run it in D1. When I do that, CF has it blocked.

npx wrangler d1 execute yourdbname --remote --command="SELECT sqlite_version()"

CF replies back with error:

not authorized to use function: sqlite_version at offset 7: SQLITE_ERROR [code: 7500]

There’s no way for you to update the version of SQlite D1 uses on deployed workers, it’s embedded in the runtime deployment/CF’s side of the stack.

The d1 team has replied in the discord for those asking about updating d1 (specifically jsonb support), and their reply was
“no known timeline at the moment. But we’re discussing an update in Q4, plus how we can stay more regular with sqlite updates.”

3 Likes

Yeah I used the command on the db file directly.

Glad to know it’s being considered, because there are loads of new features that I want to make use of.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.