DbalKeySetExtractor implements Extractor
FinalYes
Extractor implementing keyset pagination for Doctrine DBAL queries.
This extractor fetches rows page by page using keyset pagination, which is more efficient than limit/offset for large datasets. It requires a KeySet object defining the columns and sort orders for pagination. The key columns must be non-null and provide a unique ordering to ensure correct pagination.
Interfaces
- Extractor
Methods
- __construct() : mixed
- extract() : Generator
- withKeyAliasSuffix() : self
- withMaximum() : $this
- Sets the maximum number of rows to fetch.
- withPageSize() : $this
- Sets the number of rows per page.
- withSchema() : $this
- Sets the schema for the extracted rows.
Methods
__construct()
public
__construct(Connection $connection, QueryBuilder $queryBuilder, KeySet $keySet) : mixed
Parameters
- $connection : Connection
- $queryBuilder : QueryBuilder
- $keySet : KeySet
extract()
public
extract(FlowContext $context) : Generator
Parameters
- $context : FlowContext
Return values
GeneratorwithKeyAliasSuffix()
public
withKeyAliasSuffix(string $keyAliasSuffix) : self
Parameters
- $keyAliasSuffix : string
Return values
selfwithMaximum()
Sets the maximum number of rows to fetch.
public
withMaximum(int $maximum) : $this
Parameters
- $maximum : int
-
the maximum number of rows (must be > 0)
Tags
Return values
$thiswithPageSize()
Sets the number of rows per page.
public
withPageSize(int $pageSize) : $this
Parameters
- $pageSize : int
-
the page size (must be > 0)
Tags
Return values
$thiswithSchema()
Sets the schema for the extracted rows.
public
withSchema(Schema $schema) : $this
Parameters
- $schema : Schema
-
the schema to apply to rows