final class TableContextBuilder<TValue>
Restricted visibility: declared "@visibility ZtdQuery\Platform\Sqlite". Code outside that scope must not name this declaration.

Collects shadow rows, schemas and views into the rewrite context.

Methods§

public function __construct(
    private TableDefinitionRegistry $registry,
    private array<string, array<int, array<string, TValue>>> $allData,
    private ViewDefinitionSet $views,
)

Snapshots the fixtures whose values will be forwarded to platform renderers.

Parameters

$registryTableDefinitionRegistry
$allDataarray<string, array<int, array<string, TValue>>>
$viewsViewDefinitionSet
public function buildTableContext(): array<string, array{viewSql: string}|array{rows: array<int, array<string, TValue>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults: array<string, string>, identityStrategies: array<string, IdentityGenerationStrategy>, generatedExpressions: array<string, string>, primaryKeys: array<int, string>, candidateKeys: array<string, array<int, string>>}>

Build the table context map for transformers.

Returns

array<string, array{viewSql: string}|array{rows: array<int, array<string, TValue>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults: array<string, string>, identityStrategies: array<string, IdentityGenerationStrategy>, generatedExpressions: array<string, string>, primaryKeys: array<int, string>, candidateKeys: array<string, array<int, string>>}>
Test cases 1
Called from 1
Calls 8
public static function contextFromDefinition<TRowValue>(
    TableDefinition $definition,
    array<int, array<string, TRowValue>> $rows,
): array{rows: array<int, array<string, TRowValue>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults: array<string, string>, identityStrategies: array<string, IdentityGenerationStrategy>, generatedExpressions: array<string, string>, primaryKeys: array<int, string>, candidateKeys: array<string, array<int, string>>}

Parameters

$definitionTableDefinition
$rowsarray<int, array<string, TRowValue>>

Returns

array{rows: array<int, array<string, TRowValue>>, columns: array<int, string>, columnTypes: array<string, ColumnDeclaration>, columnDefaults: array<string, string>, identityStrategies: array<string, IdentityGenerationStrategy>, generatedExpressions: array<string, string>, primaryKeys: array<int, string>, candidateKeys: array<string, array<int, string>>}
Test cases 1
Called from 3
Calls 1
public static function columnsFromRows<TRowValue>(array<int, array<string, TRowValue>> $rows): list<string>

Collects columns in their first-seen order across heterogeneous fixture rows.

Parameters

$rowsarray<int, array<string, TRowValue>>

Returns

list<string>
Test cases 1
Called from 1
Calls 2

Private surface 3§

Implementation details, listed for orientation only.

private TableDefinitionRegistry $registry
private array<string, array<int, array<string, TValue>>> $allData
private ViewDefinitionSet $views

Test cases 6§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Method calls 1