classPreparedParameters
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.
$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> $typesMethods§
public function __construct(list<TypeName> $types)Parameters
$types | list<TypeName> | The declared parameter types in order; at least one |
Calls 2
- static-call Check::listOf() line 50
- class-const TypeName::class() line 50
public function infersUndeclared(): boolAnswers that a parameter beyond the declared types is inferred from its use.
Returns
boolpublic function deriveRelation(Derivation $derivation, Environment $environment): RelationFactDerives the types and answers the row of the declared parameters.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 4
- new OutputSlot line 69
- class-const Nullability::Nullable() line 69
- new RelationFact line 72
- new RowShape line 72
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.