(executor: DbExecutor)
| 1000 | : whereClause |
| 1001 | |
| 1002 | const buildPageQuery = (executor: DbExecutor) => { |
| 1003 | const query = executor |
| 1004 | .select() |
| 1005 | .from(userTableRows) |
| 1006 | .where(pageWhere ?? baseConditions) |
| 1007 | .orderBy(buildRowOrderBySql(sort, tableName, columns, fractionalOrdering)) |
| 1008 | return after ? query.limit(limit) : query.limit(limit).offset(offset) |
| 1009 | } |
| 1010 | |
| 1011 | // Count and page fetch are independent reads — run them concurrently so the |
| 1012 | // `includeTotal` hot path doesn't pay two serial round-trips. Filtered counts |
no test coverage detected