Upgrade sqlite version

I use Redash’s Query Results datasource (which is really neat), but the sqlite that my Redash is using doesn’t support sqrt and related math functions. It seems that support for that was added in sqlite 3.35. My sqlite came from the V8 AMIs upgraded to V10.

Is it possible to upgrade sqlite in place in my self-hosted Redash?

Yes you can do this by writing your own Dockerfile to extend our image and upgrade the version.

Or if you’re feeling extra charitable, you can open a PR against getredash/redash that we can merge into master so everyone can benefit after we rebuild the cloud images :wink:

As far as a PR against the Dockerfile:

  1. There’s no reference to sqlite3 or libsqlite3 in getredash/redash/blob/master/Dockerfile . Does it get pulled in as a dep of something else? Should it be installed explicitly?

  2. No other packages refer to minimum version numbers in the Dockerfile, and it’s not obvious to me how and where to specify a minimum version, or even if it’s good policy.


I believe sqlite is included as part of the Python3 installation, which is taken from our base image (currently python:3.7-slim-buster). However you can explicitly install a specific version of sqlite as needed.

Thanks. I don’t know if Python 3.7 specifies a version for sqlite, but Debian does.

Buster (current base image) is on sqlite 3.27.2 - Debian -- Details of package libsqlite3-0 in buster

Bullseye (latest Debian stable) is on sqlite 3.34.1, which is still below the version 3.35 where power() was introduced - Debian -- Details of package libsqlite3-0 in bullseye

Bookworm (Debian testing) is our winner with sqlite 3.36.0 - Debian -- Details of package libsqlite3-0 in bookworm

So (I think) whenever Redash changes its base image to Bookworm or later, everyone will get the new fancy sqlite with no other changes to the Dockerfile.

That’s true. But we’re not likely to change the base image any time soon.

You can port these instructions to the Dockerfile to upgrade SQLite on your instance of Redash.