classExpressionRules
final class ExpressionRules
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Assigns types and NULL facts to supported scalar operations.
Properties§
public Dialect $dialectMethods§
public function __construct(public Dialect $dialect)Binds the dependencies used for semantic binding.
Parameters
$dialect | Dialect |
public function call(string $name, list<Expression> $operands, Node $source): ExpressionParameters
$name | string | |
$operands | list<Expression> | |
$source | Node |
Returns
Throws
Called from 1
Calls 13
- function-call
countline 36 - new SemanticException line 37
- method-call TypeResolution::common() line 39
- new TypeResolution line 39
- method-call Dialect::platform() line 41
- static-call NullFacts::coalesce() line 42
- new Expression line 43
- class-const ExpressionKind::Coalesce() line 43
- static-call NullFacts::extensions() line 43
- static-call Tree::unsupported() line 47
- class-const Nullability::AlwaysNull() line 50
- class-const Nullability::MaybeNull() line 50
- class-const ExpressionKind::NullIf() line 51
public function coerce(Expression $operand, TypeDescriptor $type): ExpressionRecords a type-directed implicit conversion without evaluating its value.
Parameters
$operand | Expression | |
$type | TypeDescriptor |
Returns
Called from 2
Calls 2
- new Expression line 66
- class-const ExpressionKind::Cast() line 66
public function operator(
string $operator,
non-empty-list<Expression> $operands,
Node $source,
): ExpressionParameters
$operator | string | |
$operands | non-empty-list<Expression> | |
$source | Node |
Returns
Called from 3
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:115
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:120
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:124
Calls 15
- function-call
strtoupperline 74 - static-call NullFacts::strict() line 75
- new TypeResolution line 76
- function-call
in_arrayline 77 - method-call TypeResolution::boolean() line 78
- class-const Nullability::NotNull() line 79
- method-call ExpressionRules::predicate() line 82
- static-call NullFacts::coalesce() line 85
- class-const Nullability::MaybeNull() line 85
- method-call TypeResolution::common() line 87
- method-call ExpressionRules::arithmetic() line 93
- static-call Tree::unsupported() line 95
- new Expression line 98
- class-const ExpressionKind::Operator() line 98
- static-call NullFacts::extensions() line 98
public function arithmetic(
string $operator,
non-empty-list<Expression> $operands,
Node $source,
): TypeDescriptorResolves supported numeric operations, including signed literal boundaries.
Parameters
$operator | string | |
$operands | non-empty-list<Expression> | |
$source | Node |
Returns
Called from 1
Calls 1
- method-call Dialect::platform() line 108
public function predicate(Expression $expression): voidParameters
$expression | Expression |
Throws
Called from 3
- method-call SqlSemantics\Core\Binding\ExpressionRules::operator() packages/sql-semantics/src/Core/Binding/ExpressionRules.php:82
- method-call SqlSemantics\Core\Binding\FromBinder::join() packages/sql-semantics/src/Core/Binding/FromBinder.php:101
- method-call SqlSemantics\Core\Binding\SelectBinder::bind() packages/sql-semantics/src/Core/Binding/SelectBinder.php:52
Calls 1
- method-call Dialect::platform() line 116
Test cases 60§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExpressionRulesTestcalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsTypeRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcallsTypeRulesTestcalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\PostgreSql\TypeRules::coalesce() packages/sql-semantics-postgres/src/TypeRules.php:221
- new SqlSemantics\Platform\PostgreSql\TypeRules::project() packages/sql-semantics-postgres/src/TypeRules.php:230
- new SqlSemantics\Core\Binding\ExpressionBinder::call() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:105
- new SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:113
- new SqlSemantics\Core\Binding\FromBinder::join() packages/sql-semantics/src/Core/Binding/FromBinder.php:101
- new SqlSemantics\Core\Binding\SelectBinder::bind() packages/sql-semantics/src/Core/Binding/SelectBinder.php:52
Method calls 8
- method-call SqlSemantics\Platform\PostgreSql\TypeRules::coalesce() packages/sql-semantics-postgres/src/TypeRules.php:221
- method-call SqlSemantics\Platform\PostgreSql\TypeRules::project() packages/sql-semantics-postgres/src/TypeRules.php:230
- method-call SqlSemantics\Core\Binding\ExpressionBinder::call() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:105
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:115
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:120
- method-call SqlSemantics\Core\Binding\ExpressionBinder::operation() packages/sql-semantics/src/Core/Binding/ExpressionBinder.php:124
- method-call SqlSemantics\Core\Binding\FromBinder::join() packages/sql-semantics/src/Core/Binding/FromBinder.php:101
- method-call SqlSemantics\Core\Binding\SelectBinder::bind() packages/sql-semantics/src/Core/Binding/SelectBinder.php:52