Skip to content

Commit 2734800

Browse files
committed
refactor(routing): rename queryRows total to fetched (RI-02 simplify)
1 parent 7a498ad commit 2734800

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/routing/history/indexer.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function queryRows(
475475
filters: RequestHistoryFilters,
476476
cursor: HistoryCursor | null,
477477
limit: number,
478-
): { rows: Array<HistoryQueryRow>; total: number } {
478+
): { rows: Array<HistoryQueryRow>; fetched: number } {
479479
const where: string[] = [];
480480
const values: Array<string | number> = [];
481481
const add = (clause: string, value: string | number) => {
@@ -502,7 +502,7 @@ function queryRows(
502502
const rows = handle.query(
503503
`SELECT row_json, timestamp, request_id FROM requests${whereSql} ORDER BY timestamp DESC, request_id DESC LIMIT ?`,
504504
).all(...values, limit + 1) as Array<HistoryQueryRow>;
505-
return { rows, total: rows.length };
505+
return { rows, fetched: rows.length };
506506
}
507507

508508
function requireDb(): Database {
@@ -539,8 +539,8 @@ export async function queryRequestHistory(
539539
REQUEST_HISTORY_MAX_PAGE_SIZE,
540540
);
541541
const handle = requireDb();
542-
const { rows, total } = queryRows(handle, filters, cursor, limit);
543-
const hasMore = total > limit;
542+
const { rows, fetched } = queryRows(handle, filters, cursor, limit);
543+
const hasMore = fetched > limit;
544544
const pageRows = rows.slice(0, limit);
545545
const entries: PersistedUsageEntry[] = [];
546546
for (const row of pageRows) {

0 commit comments

Comments
 (0)