From a7d1a30cf25e23571b728bb426e7fbedd6d471fa Mon Sep 17 00:00:00 2001 From: ziggie Date: Wed, 11 Feb 2026 12:40:25 +0100 Subject: [PATCH] sqldb: wire up PragmaOptions config for SQLite store The SqliteConfig.PragmaOptions field existed but was never appended to the DSN. Add the loop to apply user-specified pragma options after the built-in ones, matching the existing behavior in kvdb/sqlite. --- sqldb/sqlite.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqldb/sqlite.go b/sqldb/sqlite.go index fc724e939..ede2999ad 100644 --- a/sqldb/sqlite.go +++ b/sqldb/sqlite.go @@ -100,6 +100,12 @@ func NewSqliteStore(cfg *SqliteConfig, dbPath string) (*SqliteStore, error) { ) } + // Then we add any user specified pragma options. Note that these can + // be of the form: "key=value", "key(N)" or "key". + for _, option := range cfg.PragmaOptions { + sqliteOptions.Add(sqliteOptionPrefix, option) + } + // Construct the DSN which is just the database file name, appended // with the series of pragma options as a query URL string. For more // details on the formatting here, see the modernc.org/sqlite docs: