final class PreparedParameters
    implements ParameterDeclarations
    uses Snapshot
Public API: explicitly declared with @visibility public.

The parenthesized parameter types of PREPARE.

Mirrors the argtypes of PostgreSQL's PrepareStmt. Rule: PG-PREPARE-PARAMETERS-001. The list is a relation of one unnamed slot per declared type, in order: $n of the prepared statement has the type of slot n and can be NULL. "If a parameter data type is not specified or is

  • declared as unknown, the type is inferred from the context in which the
  • parameter is first referenced": a parameter beyond the list stays

dependent on its use. Source: https://www.postgresql.org/docs/17/sql-prepare.html. Status: Implemented.

Reading the declared parameter typesdoctest
$prepare = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('PREPARE p (integer, text) AS SELECT $2', []);
    [count($prepare->statement->parameters->types), $prepare->facts->query($prepare->statement->statement)->projection[0]->type->descriptor->name()] // => [2, 'text']

Properties§

public non-empty-list<TypeName> $types

Methods§

public function __construct(list<TypeName> $types)

Parameters

$typeslist<TypeName>The declared parameter types in order; at least one
Calls 2
public function infersUndeclared(): bool

Answers that a parameter beyond the declared types is inferred from its use.

Returns

bool
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Derives the types and answers the row of the declared parameters.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 4
public function render(Output $out): void

Writes the types in parentheses.

Parameters

$outOutput
Calls 1

Test cases 2§

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 1

Relations§

Instantiated in 1
Type declarations 1