[PR #3899] [MERGED] Allows setting of some pragma values through environment variables #4114

Closed
opened 2026-04-25 00:18:22 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3899
Author: @mikiher
Created: 1/26/2025
Status: Merged
Merged: 1/27/2025
Merged by: @advplyr

Base: masterHead: pragma-from-env


📝 Commits (1)

  • 23067e1 Allows setting of some pragma values through environment variables

📊 Changes

1 file changed (+22 additions, -0 deletions)

View changed files

📝 server/Database.js (+22 -0)

📄 Description

Brief summary

Adds support for setting some whitelisted SQLite PRAGMA values through environment variables.

Which issue is fixed?

Fixes #3750

In-depth Description

A whitelist of allowed pragma settings is defined, which currently contains mmap_size, cache_size, and temp_store.
Users can set the values for those pragmas, by setting the environment variable SQLITE_<UPPERCASE_PRAGMA_NAME> (e.g. SQLITE_MMAP_SIZE) to the requested value.

These helped the reporting user optimize their database, and could be used by us in the future to set reasonable default values.

How have you tested this?

Set up all the supported pragmas through the corresponding env variables.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3899 **Author:** [@mikiher](https://github.com/mikiher) **Created:** 1/26/2025 **Status:** ✅ Merged **Merged:** 1/27/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `pragma-from-env` --- ### 📝 Commits (1) - [`23067e1`](https://github.com/advplyr/audiobookshelf/commit/23067e1818751dcc8aed9087745db266e846b0be) Allows setting of some pragma values through environment variables ### 📊 Changes **1 file changed** (+22 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/Database.js` (+22 -0) </details> ### 📄 Description ## Brief summary Adds support for setting some whitelisted SQLite PRAGMA values through environment variables. ## Which issue is fixed? Fixes #3750 ## In-depth Description A whitelist of allowed pragma settings is defined, which currently contains `mmap_size`, `cache_size`, and `temp_store`. Users can set the values for those pragmas, by setting the environment variable `SQLITE_<UPPERCASE_PRAGMA_NAME>` (e.g. SQLITE_MMAP_SIZE) to the requested value. These helped the reporting user optimize their database, and could be used by us in the future to set reasonable default values. ## How have you tested this? Set up all the supported pragmas through the corresponding env variables. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:22 +02:00
adam closed this issue 2026-04-25 00:18:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4114