From 8ac67ebebd8bbd8401f523e42a86dbce297f6e4f Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 20 Oct 2025 18:00:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0SQLite=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=90=AF=E7=94=A8=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E7=BC=93=E5=AD=98=E5=92=8CWAL=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=BF=99=E7=AD=89=E5=BE=85=E5=92=8C?= =?UTF-8?q?=E5=86=85=E5=AD=98=E6=98=A0=E5=B0=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/framework/database/db/db.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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{