| 77 | } |
| 78 | |
| 79 | export interface DbQueryOpts { |
| 80 | limit: number; |
| 81 | before?: number; // timestamp < before(游标翻页) |
| 82 | since?: number; // timestamp >= since(时间范围) |
| 83 | status?: string; // 精确匹配 summary.status |
| 84 | keyword?: string; // 模糊匹配 title/model/request_id |
| 85 | } |
| 86 | |
| 87 | /** 动态构建 WHERE 子句(参数化,防注入) */ |
| 88 | function buildWhere(opts: Omit<DbQueryOpts, 'limit'>): { where: string; params: Record<string, unknown> } { |
nothing calls this directly
no outgoing calls
no test coverage detected