classValuesList
final class ValuesList
implements Statement, Query, OutputNaming
uses Snapshot
Public API: explicitly declared with
@visibility public.VALUES: a constant table of rows written in the query.
Mirrors the valuesLists form of PostgreSQL's SelectStmt. The facts follow PG-VALUES-001. Source: https://www.postgresql.org/docs/17/sql-values.html.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("VALUES (1, 'a'), (2, NULL)");
[$query->field(1)->name->value, $query->field(1)->type->descriptor->name(), $query->field(1)->nullability->name] // => ['column2', 'text', 'Nullable']Properties§
public non-empty-list<ValuesRow> $rowsMethods§
public function __construct(list<ValuesRow> $rows)Parameters
$rows | list<ValuesRow> | The rows in written order; at least one |
Calls 2
- static-call Check::listOf() line 47
- class-const ValuesRow::class() line 47
public function outputName(): Namepublic function deriveStatement(Derivation $derivation): voidDerives the list as a statement root.
Parameters
$derivation | Derivation |
Calls 2
- method-call QueryRoots::derive() line 63
- new QueryRoots line 63
public function deriveQuery(Derivation $derivation, Environment $outer): QueryFactDerives the rows and the output columns.
Parameters
$derivation | Derivation | |
$outer | Environment |
Returns
Calls 2
- method-call ValuesFacts::derive() line 71
- new ValuesFacts line 71
public function render(Output $out): voidTest cases 7§
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 6
QueriesTest::testQueryLowersASubquerycallsCarriersTest::testCarryAddsAnOccurrenceNoNameReachescallsCarriersTest::testCoreUnwrapsParenthesesAndClausescallsCarriersTest::testTakeAnswersTheCarriersOfAQuerycallsCarrierTest::testDeriveRelationAnswersARowWithoutColumnscallsCarrierTest::testRenderWritesNothingcalls
Relations§
Instantiated in 1
Type checks 5
- instanceof SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::rows() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:113
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Sources::statement() packages/sql-semantics-postgres/src/Rules/Manipulation/Sources.php:34
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Sources::insertable() packages/sql-semantics-postgres/src/Rules/Manipulation/Sources.php:48
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Query\QueryExpression::__construct() packages/sql-semantics-postgres/src/Statement/Query/QueryExpression.php:53
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Query\SetOperation::__construct() packages/sql-semantics-postgres/src/Statement/Query/SetOperation.php:55