sfsqlquery Namespace
Contains classes for executing SQL queries against Data 360 data spaces from Apex.
The following are the classes in the sfsqlquery namespace.
-
Tracks the runtime execution state of a Data 360 SQL query as it progresses through submission, execution, and result retrieval. Use
QueryHandleto resume a previously submitted query from a saved query ID in a newSqlRowIteratoror a newSqlQueueablejob. -
Wraps a single Data 360 SQL query result row and provides typed accessor methods for retrieving column values by name or by 0-based index.
Rowinstances are produced bySqlRowIteratorandSqlQueueable; you don’t constructRowobjects directly during normal usage. -
Abstract base class for executing long-running Data 360 SQL queries asynchronously in chained Queueable jobs. Implements
QueueableandDatabase.AllowsCallouts. Create a concrete subclass that implementsprocessDataChunk()to process each page of results andchainNextJob()to enqueue the next job when more data remains. -
Synchronous iterator for executing Data 360 SQL queries and retrieving results row-by-row within the current transaction. Implements
Iterator<Row>andIterable<Row>for use in both for-each and while loops. The iterator is single-use; once all rows are consumed, iterating again does not restart from the beginning. -
Encapsulates the inputs required to execute a Data 360 SQL query against a data space. Build a statement from a raw SQL string or a pre-built
ConnectApi.QuerySqlInputobject, and then execute synchronously withSqlRowIteratoror pass it to aSqlQueueablesubclass for asynchronous processing. -
Test utility for mocking Data 360 SQL query API responses in Apex tests. The framework automatically detects the test context via
Test.isRunningTest()and returns mocked responses when configured. CallclearMocks()before each test to ensure a clean state.