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

Renders typed fixture rows as a named shadow-table CTE.

Methods§

public function __construct(
    private CastRenderer $castRenderer,
    private SqliteGeneratedColumnProjector $generatedColumnProjector,
    private IdentifierQuoter $quoter,
    private ValueRenderer $valueRenderer,
)

Binds the collaborators used by this operation.

Parameters

$castRendererCastRenderer
$generatedColumnProjectorSqliteGeneratedColumnProjector
$quoterIdentifierQuoter
$valueRendererValueRenderer
public function generateCte<TValue>(
    string $tableName,
    array<int, array<string, TValue>> $rows,
    array<int, string> $columns,
    array<string, ColumnDeclaration> $columnTypes,
    array<string, string> $generatedExpressions,
): string

Generate a CTE fragment for a single table.

Parameters

$tableNamestring
$rowsarray<int, array<string, TValue>>
$columnsarray<int, string>
$columnTypesarray<string, ColumnDeclaration>
$generatedExpressionsarray<string, string>

Returns

string

Throws

RuntimeException
Test cases 2
Called from 1
Calls 7
public function wrapCte(
    string $quotedTable,
    string $baseSql,
    array<int, string> $columns,
    array<string, string> $generatedExpressions,
): string
public function renderRow<TValue>(
    array<string, TValue> $row,
    array<int, string> $columns,
    array<string, ColumnDeclaration> $columnTypes,
): string

Renders fixture values in the declared column order.

Parameters

$rowarray<string, TValue>
$columnsarray<int, string>
$columnTypesarray<string, ColumnDeclaration>

Returns

string
Test cases 1
Called from 1
Calls 3
public function renderEmptyTable(
    array<int, string> $columns,
    array<string, ColumnDeclaration> $columnTypes,
): string

Retains the declared column types even when a table has no fixture rows.

Parameters

$columnsarray<int, string>
$columnTypesarray<string, ColumnDeclaration>

Returns

string
Test cases 1
Called from 1
Calls 4

Private surface 4§

Implementation details, listed for orientation only.

private CastRenderer $castRenderer
private SqliteGeneratedColumnProjector $generatedColumnProjector
private IdentifierQuoter $quoter
private ValueRenderer $valueRenderer

Test cases 14§

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

Dedicated tests 6
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Method calls 1