etl_lib.data_source.SQLBatchSource module

class SQLBatchSource(context, task, query, record_transformer=None, **kwargs)[source]

Bases: BatchProcessor

Parameters:
__init__(context, task, query, record_transformer=None, **kwargs)[source]

Constructs a new SQLBatchSource.

Parameters:
get_batch(max_batch_size)[source]

Yield successive batches until the query is exhausted.

Calls _fetch_page() repeatedly, advancing the offset by the number of rows returned. Stops when no more rows are returned.

Parameters:

max_batch_size (int) – upper limit on rows per batch.

Yields:

BatchResults for each non-empty page.

Return type:

Generator[BatchResults, None, None]