final class ValueRows
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The VALUES rows of an INSERT: rows whose values are assigned to the target columns one by one.

PostgreSQL treats a VALUES list that is the whole source of an INSERT apart from a query: each value is converted to the type of the column it is assigned to, and a value may be DEFAULT. Source: https://www.postgresql.org/docs/17/sql-insert.html, https://www.postgresql.org/docs/17/sql-values.html.

Reading the rows of an INSERTdoctest
$insert = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('INSERT INTO t VALUES (1), (DEFAULT)');
    count($insert->statement->rows->rows()) // => 2
Refusing VALUES without a rowdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Manipulation\ValueRows([]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public non-empty-list<ValuesRow> $rows

Methods§

public function __construct(list<ValuesRow> $rows)

Parameters

$rowslist<ValuesRow>The rows in written order; at least one

Throws

InvalidConstruction When there is no row
Calls 2
public function rows(): non-empty-list<ValuesRow>

Answers the rows.

Returns

non-empty-list<ValuesRow>
public function render(Output $out): void

Writes VALUES and the rows.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 3