Skip to content

streamBulkQueryToFile

streamBulkQueryToFile(conn, soql, outputPath, options?): Promise<StreamBulkQueryToFileResult>

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

Run a SOQL query through Bulk API v2 and stream the CSV results directly to a file.

A thin convenience wrapper around streamBulkQuery for the common “just write it to disk” case. Use streamBulkQuery directly if you want to consume or transform the results without touching the filesystem (e.g. piping through a CSV parser).

Connection

The org connection to run the query on.

string

The SOQL query to run.

string

The filesystem path to write the merged CSV results to.

StreamBulkQueryOptions = {}

Optional job/polling behavior overrides.

Promise<StreamBulkQueryToFileResult>

The job ID and record count.