classParameter
final class Parameter
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A parameter marker: ?, or :name when the language profile reads named parameters.
Rule: MYSQL-PARAMETER-001. Facts: the type and the NULL fact depend on the value bound at execution, which no context holds; the fact names the marker as the missing input. Diagnostics: none. Source: https://dev.mysql.com/doc/refman/8.4/en/prepare.html. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = ?');
$query->facts->scalar($query->statement->where->right)->type->missing[0]->describe() // => 'the value bound to parameter ?'Properties§
public string $marker = '?'Methods§
public function __construct(public string $marker = '?')Parameters
$marker | string | The marker as written: `?` or `:name` |
Calls 2
- static-call Check::input() line 40
- function-call
preg_matchline 40
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the dependence on the bound value.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 4
- new ScalarFact line 48
- new Dependent line 48
- new UnboundParameter line 48
- class-const Nullability::Dependent() line 48
public function render(Output $out): voidTest cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 5
Relations§
Instantiated in 1
Type checks 5
- instanceof SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::own() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:141
- instanceof SqlSemantics\Platform\MySql\Statement\Call\Window\FrameBound::__construct() packages/sql-semantics-mysql/src/Statement/Call/Window/FrameBound.php:43
- instanceof SqlSemantics\Platform\MySql\Statement\Call\Window\WindowFunction::__construct() packages/sql-semantics-mysql/src/Statement/Call/Window/WindowFunction.php:71
- instanceof SqlSemantics\Platform\MySql\Statement\Query\Clause\RowLimit::__construct() packages/sql-semantics-mysql/src/Statement/Query/Clause/RowLimit.php:45
- instanceof SqlSemantics\Platform\MySql\Statement\Relation\Hint\TableSample::__construct() packages/sql-semantics-mysql/src/Statement/Relation/Hint/TableSample.php:40