mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-03 18:47:25 +01:00
[#875] reordered the busy_timeout pragma and added a fixed/capped connections pool for the nocgo sqlite driver
This commit is contained in:
1 parent
639522b142
commit
8bb03d2e6b
4 files changed
+28
-5
No files matched your search
+4
-1
@@ -10,7 +10,10 @@ import (
|
||||
)
|
||||
|
||||
func connectDB(dbPath string) (*dbx.DB, error) {
|
||||
pragmas := "_foreign_keys=1&_journal_mode=WAL&_synchronous=NORMAL&_busy_timeout=8000"
|
||||
// note: the busy_timeout pragma must be first because
|
||||
// the connection needs to be set to block on busy before WAL mode
|
||||
// is set in case it hasn't been already set by another connection
|
||||
pragmas := "_busy_timeout=10000&_journal_mode=WAL&_foreign_keys=1&_synchronous=NORMAL"
|
||||
|
||||
db, openErr := dbx.MustOpen("sqlite3", fmt.Sprintf("%s?%s", dbPath, pragmas))
|
||||
if openErr != nil {
|
||||
|
||||
Reference in new issue
Block a user