diff --git a/src/framework/database/db/db.go b/src/framework/database/db/db.go index eab32a93..49dcb1e7 100644 --- a/src/framework/database/db/db.go +++ b/src/framework/database/db/db.go @@ -38,12 +38,12 @@ func loadDialect() map[string]dialectInfo { switch item["type"] { case "sqlite": pragmas := []string{ - "cache=shared", // Enable shared cache - "_pragma=journal_mode(WAL)", // Enable WAL mode - "_pragma=busy_timeout(5000)", // Set busy timeout 抛出 SQLITE_BUSY 错误 默认0立即,设置等待 5 秒(5000 毫秒) - "_pragma=synchronous(NORMAL)", // Set synchronous mode - "_pragma=wal_autocheckpoint=5000", // Set WAL auto-checkpoint threshold 设置较大的自动检查点阈值 - "_pragma=mmap_size(67108864)", // Set mmap size 内存映射 I/O 最大字节数为 64MB + "cache=shared", // Enable shared cache + "_pragma=journal_mode(WAL)", // Enable WAL mode + "_pragma=busy_timeout(5000)", // Set busy timeout 抛出 SQLITE_BUSY 错误 默认0立即,设置等待 5 秒(5000 毫秒) + "_pragma=synchronous(NORMAL)", // Set synchronous mode + "_pragma=wal_autocheckpoint(5000)", // Set WAL auto-checkpoint threshold 设置较大的自动检查点阈值 + "_pragma=mmap_size(67108864)", // Set mmap size 内存映射 I/O 最大字节数为 64MB } dsn := fmt.Sprintf("%s?%s", item["database"], strings.Join(pragmas, "&")) dialects[key] = dialectInfo{