perf(api,frontend): index hot queries, paginate chats, fix realtime
This commit is contained in:
@@ -85,6 +85,18 @@ async def list_folders(pool: asyncpg.Pool, account_id: int) -> list[FolderSpec]:
|
||||
return [_row_to_folder(row) for row in rows]
|
||||
|
||||
|
||||
async def get_folder(
|
||||
pool: asyncpg.Pool, account_id: int, folder_id: int
|
||||
) -> FolderSpec | None:
|
||||
row = await pool.fetchrow(
|
||||
"SELECT folder_id, title, order_index, is_chatlist, raw "
|
||||
"FROM folders WHERE account_id = $1 AND folder_id = $2",
|
||||
account_id,
|
||||
folder_id,
|
||||
)
|
||||
return _row_to_folder(row) if row else None
|
||||
|
||||
|
||||
async def create_policy(
|
||||
pool: asyncpg.Pool,
|
||||
account_id: int | None,
|
||||
|
||||
Reference in New Issue
Block a user