How to specify connection string to Sqlite as an environment variable? #1824

Closed
opened 2025-10-09 17:31:55 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @tynor88 on GitHub.

Subject of the issue

Is it possible to specify the SQLite connectionstring, to mitgate WAL issues when hosting with Azure Files? It is possible with e.g. grafana, as specified here:
https://github.com/grafana/grafana/issues/20549#issuecomment-580743349

Originally created by @tynor88 on GitHub. ### Subject of the issue Is it possible to specify the SQLite connectionstring, to mitgate WAL issues when hosting with Azure Files? It is possible with e.g. grafana, as specified here: https://github.com/grafana/grafana/issues/20549#issuecomment-580743349
Author
Owner

@BlackDex commented on GitHub:

@TynThordin you can't.
If you want to change the settings of the sqlite database you need to do that afterwards using the sqlite3 tool it self.
Please see: https://www.sqlite.org/pragma.html

@BlackDex commented on GitHub: @TynThordin you can't. If you want to change the settings of the sqlite database you need to do that afterwards using the sqlite3 tool it self. Please see: https://www.sqlite.org/pragma.html
Author
Owner

@dani-garcia commented on GitHub:

If you mean adding the ?cache=private&mode=rwc bits, you could try adding it to the DATABASE_URL parameter, you shouldn't need the journal_mode=WAL because that's already set by code.

@dani-garcia commented on GitHub: If you mean adding the `?cache=private&mode=rwc` bits, you could try adding it to the DATABASE_URL parameter, you shouldn't need the journal_mode=WAL because that's already set by code.
Author
Owner

@yggdrasil-tynor commented on GitHub:

@dani-garcia Sorry to disturb you. Do you have any idea how to circumvent this?

@yggdrasil-tynor commented on GitHub: @dani-garcia Sorry to disturb you. Do you have any idea how to circumvent this?
Author
Owner

@voslucas commented on GitHub:

@yggdrasil-tynor @tynor88 did you find a solution for sqlite3 hosting on Azure Files?

@voslucas commented on GitHub: @yggdrasil-tynor @tynor88 did you find a solution for sqlite3 hosting on Azure Files?
Author
Owner

@yggdrasil-tynor commented on GitHub:

@dani-garcia Thanks for the reply. However it does not work. It tries to create a file named db.sqlite3?cache=private&mode=rwc which obviously doesnt pass the settings to sqlite.
Any idea why it would do that?

@yggdrasil-tynor commented on GitHub: @dani-garcia Thanks for the reply. However it does not work. It tries to create a file named db.sqlite3?cache=private&mode=rwc which obviously doesnt pass the settings to sqlite. Any idea why it would do that?
Author
Owner

@yggdrasil-tynor commented on GitHub:

@yggdrasil-tynor @tynor88 did you find a solution for sqlite3 hosting on Azure Files?

Download the sqlitedb file and change the PRAGMA. See what @BlackDex linked to.

We are running it stable for a year now with azure files.

@yggdrasil-tynor commented on GitHub: > @yggdrasil-tynor @tynor88 did you find a solution for sqlite3 hosting on Azure Files? Download the sqlitedb file and change the PRAGMA. See what @BlackDex linked to. We are running it stable for a year now with azure files.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1824