From eeb96b17981232e319b5acc620ea3cc0fe403c6b Mon Sep 17 00:00:00 2001 From: bin Date: Sat, 4 Oct 2025 22:00:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20SQLite=20?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=88=9D=E5=A7=8B=E5=8C=96=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=B9=B6=E5=A2=9E=E5=BC=BA=E4=BC=9A=E8=AF=9D=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=9A=E8=AF=9D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=A2=9E=E5=8A=A0=E8=BE=93=E5=85=A5=E9=98=B2=E6=8A=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/db/sqlite.py | 7 + dashboard/src/views/ConversationPage.vue | 175 +++++++++--------- dashboard/src/views/SessionManagementPage.vue | 5 +- 3 files changed, 102 insertions(+), 85 deletions(-) diff --git a/astrbot/core/db/sqlite.py b/astrbot/core/db/sqlite.py index d8c1684a7..ee0cd46ad 100644 --- a/astrbot/core/db/sqlite.py +++ b/astrbot/core/db/sqlite.py @@ -32,6 +32,12 @@ async def initialize(self) -> None: """Initialize the database by creating tables if they do not exist.""" async with self.engine.begin() as conn: await conn.run_sync(SQLModel.metadata.create_all) + await conn.execute(text("PRAGMA journal_mode=WAL")) + await conn.execute(text("PRAGMA synchronous=NORMAL")) + await conn.execute(text("PRAGMA cache_size=50000")) + await conn.execute(text("PRAGMA temp_store=MEMORY")) + await conn.execute(text("PRAGMA mmap_size=268435456")) + await conn.execute(text("PRAGMA optimize")) await conn.commit() # ==== @@ -160,6 +166,7 @@ async def get_filtered_conversations( col(ConversationV2.title).ilike(f"%{search_query}%"), col(ConversationV2.content).ilike(f"%{search_query}%"), col(ConversationV2.user_id).ilike(f"%{search_query}%"), + col(ConversationV2.conversation_id).ilike(f"%{search_query}%"), ) ) if "message_types" in kwargs and len(kwargs["message_types"]) > 0: diff --git a/dashboard/src/views/ConversationPage.vue b/dashboard/src/views/ConversationPage.vue index 35242db78..753cd735f 100644 --- a/dashboard/src/views/ConversationPage.vue +++ b/dashboard/src/views/ConversationPage.vue @@ -10,7 +10,7 @@ + density="compact" hide-details>