Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially useful with large query result sizes, such as over 2000 records. The default maximum fetch size is 10,000 records. Modify this via the options argument.
The SOQL string.
The query options. NOTE: the autoFetch option will always be true.
The Force API base url for the instance.
Get the API version used for all connection requests.
Getter for the AuthInfo
A cloned authInfo.
Getter for the username of the Salesforce Org
Returns true if this connection is using access token auth.
Normalize a Salesforce url to include a instance information.
partial url.
Send REST API request with given HTTP request info, with connected session information and SFDX headers.
HTTP request object or URL to GET request.
HTTP API request options.
Send REST API request with given HTTP request info, with connected session information and SFDX headers. This method returns a raw http response which includes a response body and statusCode.
HTTP request object or URL to GET request.
The request Promise.
Retrieves the highest api version that is supported by the target server instance.
The max API version number. i.e 46.0
Set the API version for all connection requests.
The API version.
Use the latest API version available on this.instanceUrl.
Create and return a connection to an org using authentication info. The returned connection uses the latest API version available on the server unless the apiVersion config value is set.
The authentication info from the persistence store.
Handles connections and requests to Salesforce Orgs.
jsforce.Connection
// Uses latest API version const connection = await Connection.create(await AuthInfo.create(myAdminUsername)); connection.query('SELECT Name from Account');
// Use different API version connection.setApiVersion("42.0"); connection.query('SELECT Name from Account');