export async function paginateWithCursor<
T,
TQuery extends {
where: (condition: SQL) => TQuery;
orderBy: (...fields: SQL[]) => TQuery;
limit: (limit: number) => TQuery;
} & Promise<T[]>,
>(
baseQuery: TQuery,
cursorConfig: CursorConfig,
options?: CursorPaginationOptions,
): Promise<CursorPaginationResult<T>> {
export async function paginateWithCursor<
T,
TQuery extends {
where: (condition: SQL) => TQuery;
orderBy: (...fields: SQL[]) => TQuery;
limit: (limit: number) => TQuery;
} & Promise<T[]>,
>(
baseQuery: TQuery,
cursorConfig: CursorConfig,
options?: CursorPaginationOptions,
): Promise<CursorPaginationResult<T>> {