classTypeRules
final class TypeRules
implements TypeRules
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Sqlite TypeRules implementation.
Methods§
public function __construct(private Dialect $dialect)Retains the language identity used in semantic output.
Parameters
$dialect | Dialect |
public function read(Node $node, ?Node $table = null): TypeDescriptorReads a declared type, including table-dependent storage rules and modifiers.
Returns
Test cases 1
Calls 10
- method-call Node::tokens() line 34
- function-call
strtoupperline 47 - method-call NameRules::name() line 47
- new NameRules line 47
- function-call
implodeline 51 - method-call TypeRules::affinity() line 52
- static-call Tree::outer() line 54
- static-call Tree::text() line 55
- new TypeDescriptor line 60
- function-call
strtolowerline 60
public function canonical(string $name): ?stringResolves the built-in aliases modeled for this dialect.
Parameters
$name | string |
Returns
?stringTest cases 1
Calls 1
- function-call
strtolowerline 79
public function affinity(string $name): stringComputes storage affinity from a declaration name.
Parameters
$name | string |
Returns
stringTest cases 1
Called from 1
Calls 1
- function-call
str_containsline 91
public function typeName(Token $token): ?stringClassifies a literal's lexical category without converting its contents.
Parameters
$token | Token |
Returns
?stringTest cases 1
Calls 7
- function-call
str_replaceline 112 - function-call
in_arrayline 113 - function-call
preg_matchline 113 - static-call Tree::unsupported() line 114
- function-call
strtoupperline 116 - method-call TypeRules::integer() line 118
- function-call
ctype_digitline 121
public function integer(string $text): stringChooses a Sqlite integer width from its decimal spelling.
Parameters
$text | string |
Returns
stringTest cases 1
Called from 2
public function common(list<Expression> $expressions, Node|Token $source): TypeDescriptorpublic function boolean(): TypeDescriptorReturns the dialect result type of a predicate.
Returns
Test cases 2
Calls 1
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
Test cases 1
Calls 1
public function predicate(Expression $expression): voidpublic function coalesce(list<Expression> $operands, TypeDescriptor $type): list<Expression>public function project(Expression $expression): ExpressionResolves the output type of a projected literal.
Parameters
$expression | Expression |
Returns
Test cases 1
Private surface 1§
Implementation details, listed for orientation only.
private Dialect $dialectTest cases 71§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 12
TypeRulesTestcallsTypeRulesTest::testAffinityUsesDeclaredTypePrecedencecallsTypeRulesTest::testArithmeticRetainsLanguageSemanticscallsTypeRulesTest::testBooleanNamesPredicateResultcallsTypeRulesTest::testCanonicalResolvesIntegercallsTypeRulesTest::testCoalescePreservesOperandscallsTypeRulesTest::testCommonPreservesHomogeneousTypecallsTypeRulesTest::testIntegerModelsLargeMagnitudecallsTypeRulesTest::testPredicateAcceptsBooleanResultscallsTypeRulesTest::testProjectPreservesTypedValuescallsTypeRulesTest::testReadPreservesAnyValuesInStrictTablescallsTypeRulesTest::testTypeNameClassifiesIntegerTokencalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsDialectParserTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcalls