PostgreSqlCursorExtractor implements Extractor
FinalYes
PostgreSQL extractor using server-side cursors for memory-efficient extraction.
Uses DECLARE CURSOR + FETCH to stream data from PostgreSQL without loading the entire result set into memory. This is the only way to achieve true low memory extraction with PHP's ext-pgsql.
Note: Requires a transaction context (auto-started if not in one).
Interfaces
- Extractor
Methods
- __construct() : mixed
- extract() : Generator
- withCursorName() : self
- withFetchSize() : self
- withMaximum() : self
- withSchema() : self
Methods
__construct()
public
__construct(Client $client, string|SqlQuery $query[, array<int, mixed> $parameters = [] ]) : mixed
Parameters
- $client : Client
- $query : string|SqlQuery
- $parameters : array<int, mixed> = []
extract()
public
extract(FlowContext $context) : Generator
Parameters
- $context : FlowContext
Return values
GeneratorwithCursorName()
public
withCursorName(string $cursorName) : self
Parameters
- $cursorName : string
Return values
selfwithFetchSize()
public
withFetchSize(int $fetchSize) : self
Parameters
- $fetchSize : int
Return values
selfwithMaximum()
public
withMaximum(int $maximum) : self
Parameters
- $maximum : int
Return values
selfwithSchema()
public
withSchema(Schema $schema) : self
Parameters
- $schema : Schema