classValueProjection
final class ValueProjection
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Converts VALUES rows into their typed result-select projection.
Methods§
public function __construct(
private PgSqlParser $parser,
private ShadowIdentityAllocator $identityAllocator,
private InsertRowRenderer $rowRenderer,
private CastRenderer $castRenderer,
)Shares the staged identity allocator with the owning INSERT transformer.
Parameters
$parser | PgSqlParser | |
$identityAllocator | ShadowIdentityAllocator | |
$rowRenderer | InsertRowRenderer | |
$castRenderer | CastRenderer |
public function render<T>(
string $sql,
string $tableName,
list<string> $tableColumns,
list<string> $insertColumns,
array{rows?: array<int, array<string, T>>, columnTypes?: array<string, ColumnDeclaration>, columnDefaults?: array<string, string>, identityStrategies?: array<string, IdentityGenerationStrategy>, storageTable?: string} $table,
): stringProjects each VALUES row with defaults, generated identities and declared casts.
Parameters
$sql | string | |
$tableName | string | |
$tableColumns | list<string> | |
$insertColumns | list<string> | |
$table | array{rows?: array<int, array<string, T>>, columnTypes?: array<string, ColumnDeclaration>, columnDefaults?: array<string, string>, identityStrategies?: array<string, IdentityGenerationStrategy>, storageTable?: string} |
Returns
stringThrows
Test cases 1
Called from 1
Calls 12
- static-call SqlTokenStream::tokenize() line 44
- static-call PgSqlLexerProfile::create() line 44
- method-call PgSqlParser::extractInsertValues() line 46
- new UnsupportedSqlException line 48
- function-call
countline 55 - method-call InsertRowRenderer::providedExpressions() line 58
- method-call ShadowIdentityAllocator::allocateMissing() line 59
- function-call
array_keysline 62 - method-call InsertRowRenderer::render() line 65
- method-call ExpressionCast::projection() line 67
- new ExpressionCast line 67
- function-call
implodeline 70
Private surface 4§
Implementation details, listed for orientation only.
private PgSqlParser $parserprivate ShadowIdentityAllocator $identityAllocatorprivate InsertRowRenderer $rowRendererprivate CastRenderer $castRendererTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 5
PgSqlSessionFactoryTestcallsPgSqlRewriterTestcallsStatementRewriterTestcallsInsertTransformerTestcallsPgSqlTransformerTestcalls