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.
This commit is contained in:
ziggie committed 2026-02-11 13:15:56 +01:00
1 parent 57fd965932
commit a7d1a30cf2
1 file changed
+6
+6
View File
@@ -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 // Construct the DSN which is just the database file name, appended
// with the series of pragma options as a query URL string. For more // with the series of pragma options as a query URL string. For more
// details on the formatting here, see the modernc.org/sqlite docs: // details on the formatting here, see the modernc.org/sqlite docs: