final class Execute
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

EXECUTE: a run of a prepared statement with values for its parameters.

Mirrors PostgreSQL's ExecuteStmt (name, params). Rule: PG-EXECUTE-001. The values are derived in the empty environment. The prepared statement is session state, so the rows returned are an open shape that depends on it. Source: https://www.postgresql.org/docs/17/sql-execute.html. Status: Implemented.

Reading a run of a prepared statementdoctest
$execute = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("EXECUTE p (1, 'x')");
    [count($execute->statement->parameters), $execute->shape()->complete()] // => [2, false]

Properties§

public list<Scalar> $parameters
public Name $name

Methods§

public function __construct(public Name $name, list<Scalar> $parameters = [])

Parameters

$nameNameThe name of the prepared statement
$parameterslist<Scalar>The parameter values in order

Throws

InvalidConstruction When a value is not an expression
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the values and records the open rows of the prepared statement.

Parameters

$derivationDerivation
Calls 3
public function deriveParameters(Derivation $derivation): void

Derives the values, for a statement that runs the prepared statement for another purpose, such as CREATE TABLE AS EXECUTE.

Parameters

$derivationDerivation
Called from 1
Calls 5
public function rows(Derivation $derivation): QueryFact

Answers the rows of the prepared statement: an open shape that depends on the session.

Parameters

$derivationDerivation

Returns

Called from 1
Calls 3
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 3

Test cases 4§

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 3

Relations§

Instantiated in 3