Skip to content

streamBulkQuery

streamBulkQuery(conn, soql, options?): Promise<StreamBulkQueryResult>

Defined in: packages/simply-core/src/bulk/streamBulkQuery.ts:197

Run a SOQL query through Bulk API v2 and return the merged CSV results as a single stream.

Unlike Connection.bulk2.query(), which routes result pages through jsforce’s HTTP transport (buffering each page fully into memory before it can be consumed), this fetches each page’s HTTP response directly and exposes it as one continuous, backpressure-respecting Readable, so memory usage stays flat regardless of result set size. Pages are fetched lazily, one at a time, only as the returned stream is consumed.

Connection

The org connection to run the query on.

string

The SOQL query to run.

StreamBulkQueryOptions = {}

Optional job/polling behavior overrides.

Promise<StreamBulkQueryResult>

The job ID, record count, and a merged CSV stream of the results.

If the query job doesn’t report completion after polling.