mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-23 07:32:01 +00:00
PostgreSQL 上和 SQLite 一致的两处:知识库统计的 sum 转成整数(PostgreSQL 的 sum 交回 numeric,驱动给 Decimal);对象索引按注释搜索不分大小写(SQLite 的 LIKE 对 ASCII 本来就不分,PostgreSQL 分,改用 icontains)
This commit is contained in:
@@ -399,7 +399,8 @@ async def list_collections(session: AsyncSession) -> list[dict[str, Any]]:
|
||||
func.sum(Document.chunk_count),
|
||||
).group_by(Document.collection)
|
||||
)
|
||||
# sum 在 PostgreSQL 上给的是 numeric(驱动交回 Decimal),SQLite 给整数:一律转成 int
|
||||
return [
|
||||
{"collection": name, "documents": docs, "chunks": chunks or 0}
|
||||
{"collection": name, "documents": int(docs), "chunks": int(chunks or 0)}
|
||||
for name, docs, chunks in rows
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user