feat: 优化 SQLite 数据库初始化设置并增强会话搜索功能,会话管理增加输入防抖 #2969
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
这是对 #2952 的重新提交,是一个更干净的提交,不包含多余的commits。
Motivation / 动机
Modifications / 改动点
1、优化了sqlite配置,启用WAL模式和NORMAL,优化并发读写性能,同时增加了一些缓存策略。
2、对话数据,列表显示会话id字段,查询增加会话id条件(会话id指cid,原来的sessionId改为用户id)。
3、对话数据,增加请求打断功能,现在查询时仍然允许输入,如上一次请求没有完成将会被取消。
4、会话管理,搜索框增加输入防抖。
Verification Steps / 验证步骤
Screenshots or Test Results / 运行截图或测试结果
新的sqlite配置中普通查询平均快100ms左右

这是原来的配置

Compatibility & Breaking Changes / 兼容性与破坏性变更
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Sourcery 总结
优化 SQLite 性能,并提升对话和会话管理页面的交互性和性能。
新功能:
改进:
Original summary in English
Summary by Sourcery
Optimize SQLite performance and enhance interactivity and performance on the conversation and session management pages.
New Features:
Enhancements:
Sourcery 总结
优化 SQLite 数据库初始化以提高性能;通过可取消的查询、防抖输入以及丰富的搜索和显示功能来增强会话和对话管理。
新功能:
改进:
conversation_id过滤,添加对话 ID 列,并在加载期间保持筛选器控件的交互性。sessionId重命名为user ID,并对长 ID 应用text-truncate样式。Original summary in English
Summary by Sourcery
Optimize SQLite database initialization for improved performance; enhance conversation and session management with cancelable queries, debounced inputs, and enriched search and display capabilities.
New Features:
Enhancements: