chunkedInQuery
chunkedInQuery<
T>(connection,values,buildSoql,options):Promise<T[]>
Defined in: packages/simply-core/src/query/chunkedInQuery.ts:55
Run a SOQL query once per chunk of values, splicing each chunk into a quoted, comma-joined
IN (...) clause, and return every record from every chunk.
SOQL statements are length-limited, so any query filtering on a caller-supplied list has to be split. That splitting — chunk, quote, join, query, accumulate — is the same everywhere; only the query text and the chunk size differ.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”connection
Section titled “connection”Connection
The org connection to query against.
values
Section titled “values”readonly string[]
The values to filter on. Quoted and escaped for you; pass them raw.
buildSoql
Section titled “buildSoql”(inClause) => string
Builds the query for one chunk, given the ready-to-use IN clause body
(e.g. (clause) => `SELECT Id FROM Account WHERE Name IN (${clause})` ).
options
Section titled “options”Chunk size, and whether to use the Tooling API or tolerate failures.
Returns
Section titled “Returns”Promise<T[]>
Every record returned across all chunks, in chunk order. Empty if values is empty.