QueryResult
Defined in: src/query/queryResult.ts:19
One page of query results.
A page is one request: to read further, run the query again with an offset() past this page.
Example
Section titled “Example”const page = await client .select({ $key: true }) .where(eq("category", "docs")) .orderBy(asc("$key")) .limit(20) .offset(40) .fetch()Type Parameters
Section titled “Type Parameters”TEntity
Section titled “TEntity”TEntity = Record<string, unknown>
The shape of each row, inferred from the selection by client.select().
TCount
Section titled “TCount”TCount extends bigint | undefined = bigint | undefined
bigint when the query was built with withCount(), and undefined when it
was not.
Properties
Section titled “Properties”blockNumber
Section titled “blockNumber”
readonlyblockNumber:bigint
Defined in: src/query/queryResult.ts:29
The block this page was read at. Every request reads the latest block, so two pages of one query can come from different blocks.
readonlycount:TCount
Defined in: src/query/queryResult.ts:45
How many entities the query matches in all, regardless of the limit and offset — a bigint
when the query was built with withCount(), and undefined otherwise. It includes entities
left out for not fitting the schema, which skipped reports per page.
entities
Section titled “entities”
readonlyentities: readonlyTEntity[]
Defined in: src/query/queryResult.ts:24
The rows on this page — flat, as the selection lays them out.
skipped
Section titled “skipped”
readonlyskipped:number
Defined in: src/query/queryResult.ts:39
How many matching entities this page left out because they did not fit the schema — always
0 without a schema, or with .from(schema, { onMismatch: "throw" }).
The node counts them toward the limit and the offset, so entities.length + skipped is how
many matches this page covered: add it to the offset to reach the next page. With an explicit
limit(), a page that covered fewer than the limit was the last. An empty page is not the
end on its own: every match on it may have been skipped.