classTableContextBuilder
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
$registry | TableDefinitionRegistry | |
$allData | array<string, array<int, array<string, TValue>>> | |
$views | ViewDefinitionSet |
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>>}>Called from 1
Calls 8
- method-call TableDefinitionRegistry::get() line 51
- static-call TableContextBuilder::contextFromDefinition() line 53
- static-call TableContextBuilder::columnsFromRows() line 55
- method-call TableDefinitionRegistry::getAll() line 70
- method-call TableDefinitionRegistry::getAllRemoved() line 78
- method-call SqliteViewShadowRenderer::render() line 82
- new SqliteViewShadowRenderer line 82
- function-call
array_keysline 82
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
$definition | TableDefinition | |
$rows | array<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>>}Called from 3
- static-call ZtdQuery\Platform\Sqlite\Rewrite\Context\TableContextBuilder::buildTableContext() packages/ztd-query-sqlite/src/Rewrite/Context/TableContextBuilder.php:53
- static-call ZtdQuery\Platform\Sqlite\Rewrite\Context\TableContextBuilder::buildTableContext() packages/ztd-query-sqlite/src/Rewrite/Context/TableContextBuilder.php:76
- static-call ZtdQuery\Platform\Sqlite\Rewrite\Context\TableContextBuilder::buildTableContext() packages/ztd-query-sqlite/src/Rewrite/Context/TableContextBuilder.php:79
Calls 1
- method-call TableDefinition::candidateKeys() line 116
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
$rows | array<int, array<string, TRowValue>> |
Returns
list<string>Test cases 1
Called from 1
Private surface 3§
Implementation details, listed for orientation only.
private TableDefinitionRegistry $registryprivate array<string, array<int, array<string, TValue>>> $allDataprivate ViewDefinitionSet $viewsTest 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
SqliteRewriterTestcallsStatementRewriterTestcallsSqliteSessionFactoryTestcalls