classAnalysisContext
final class AnalysisContext
implements AnalysisContext
uses Snapshot
Public API: explicitly declared with
@visibility public.A fixed language profile together with an immutable snapshot of relation declarations.
The context states what is known: the declarations, whether they enumerate every relation, and how names are compared. The same declaration object given twice is kept once; different objects with the same name are kept as a conflict. Nothing replaces a declaration, and no statement changes a context. Routines, data types and session variables are not declared in a version 1 context; facts that need them name them as missing inputs.
$semantics = new \SqlSemantics\Platform\PostgreSql\Semantics();
[$semantics->context()->complete, $semantics->context([])->complete] // => [false, true]Properties§
public list<Table> $tablespublic non-empty-list<Name> $searchPathpublic Name $declarationSchemapublic LanguageProfile $profilepublic bool $complete = truepublic Comparison $relationNames = Comparison::Sensitivepublic Comparison $columnNames = Comparison::SensitiveMethods§
public function __construct(
public LanguageProfile $profile,
list<Name> $searchPath,
list<Table> $tables = [],
public bool $complete = true,
public Comparison $relationNames = Comparison::Sensitive,
public Comparison $columnNames = Comparison::Sensitive,
Name|null $declarationSchema = null,
)Parameters
$profile | LanguageProfile | The fixed language profile |
$searchPath | list<Name> | The schemas searched for an unqualified relation name; at least one |
$tables | list<Table> | The relation declarations |
$complete | bool | Whether the declarations enumerate every relation of the database |
$relationNames | Comparison | How relation and schema names are compared |
$columnNames | Comparison | How column names are compared |
$declarationSchema | Name|null | The schema an unqualified declaration belongs to; the first searched schema by default |
Calls 8
- class-const Comparison::Sensitive() line 62
- static-call Check::listOf() line 66
- class-const Name::class() line 66
- class-const Table::class() line 68
- static-call Check::input() line 69
- method-call LanguageProfile::compatibleWith() line 69
- function-call
spl_object_idline 70 - function-call
array_valuesline 73
public function declared(QualifiedName $name, Name $schema): list<Table>Finds the declarations with a relation name in one schema; every distinct declaration object is kept.
Parameters
$name | QualifiedName | |
$schema | Name |
Returns
list<Table>Called from 2
Calls 1
- method-call Comparison::equal() line 86
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 1
Relations§
Instantiated in 2
Method calls 2
Type checks 1
Type declarations 38
- type SqlSemantics\Platform\PostgreSql\Model\Construction\Derivation packages/sql-semantics-postgres/src/Model/Construction/Derivation.php:69
- type SqlSemantics\Platform\PostgreSql\Model\Construction\Derivation packages/sql-semantics-postgres/src/Model/Construction/Derivation.php:84
- type SqlSemantics\Platform\PostgreSql\Model\Construction\Derivation packages/sql-semantics-postgres/src/Model/Construction/Derivation.php:98
- type SqlSemantics\Platform\PostgreSql\Model\Resolution\Environment packages/sql-semantics-postgres/src/Model/Resolution/Environment.php:31
- type SqlSemantics\Platform\PostgreSql\Model\Resolution\TableLookup packages/sql-semantics-postgres/src/Model/Resolution/TableLookup.php:35
- type SqlSemantics\Platform\PostgreSql\Model\Statement\Operation packages/sql-semantics-postgres/src/Model/Statement/Operation.php:63
- type SqlSemantics\Platform\PostgreSql\Model\Validation\Publication packages/sql-semantics-postgres/src/Model/Validation/Publication.php:46
- type SqlSemantics\Platform\PostgreSql\Platform packages/sql-semantics-postgres/src/Platform.php:135
- type SqlSemantics\Platform\PostgreSql\Rules\Catalog\SchemaMember packages/sql-semantics-postgres/src/Rules/Catalog/SchemaMember.php:80
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\ComparisonTyping packages/sql-semantics-postgres/src/Rules/Expression/ComparisonTyping.php:64
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\ComparisonTyping packages/sql-semantics-postgres/src/Rules/Expression/ComparisonTyping.php:106
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\OperatorTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/OperatorTyping.php:100
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\OperatorTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/OperatorTyping.php:108
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\OperatorTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/OperatorTyping.php:235
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\PredicateTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/PredicateTyping.php:40
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\PredicateTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/PredicateTyping.php:60
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\PrefixTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/PrefixTyping.php:45
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\PrefixTyping packages/sql-semantics-postgres/src/Rules/Expression/Typing/PrefixTyping.php:77
- type SqlSemantics\Platform\PostgreSql\Rules\Expression\Unification packages/sql-semantics-postgres/src/Rules/Expression/Unification.php:46
- type SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:91
- type SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:180
- type SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\ColumnTyping packages/sql-semantics-postgres/src/Rules/Table/Definition/ColumnTyping.php:62
- type SqlSemantics\Platform\PostgreSql\Rules\Typing\TypeLookup packages/sql-semantics-postgres/src/Rules/Typing/TypeLookup.php:55
- type SqlSemantics\Platform\PostgreSql\Rules\Typing\TypeLookup packages/sql-semantics-postgres/src/Rules/Typing/TypeLookup.php:90
- type SqlSemantics\Platform\PostgreSql\Rules\Typing\TypeLookup packages/sql-semantics-postgres/src/Rules/Typing/TypeLookup.php:111
- type SqlSemantics\Platform\PostgreSql\Semantics packages/sql-semantics-postgres/src/Semantics.php:108
- type SqlSemantics\Platform\PostgreSql\Statement\Object\Attribute\TypeArgument packages/sql-semantics-postgres/src/Statement/Object/Attribute/TypeArgument.php:49
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\BitDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/BitDesignation.php:57
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\CharacterDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/CharacterDesignation.php:63
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\ColumnDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/ColumnDesignation.php:50
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\DatetimeDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/DatetimeDesignation.php:60
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\DecimalDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/DecimalDesignation.php:53
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\FloatDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/FloatDesignation.php:58
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\IntervalDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/IntervalDesignation.php:54
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\KeywordDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/KeywordDesignation.php:43
- type SqlSemantics\Platform\PostgreSql\Statement\Type\Designation\NamedDesignation packages/sql-semantics-postgres/src/Statement/Type/Designation/NamedDesignation.php:58
- type SqlSemantics\Platform\PostgreSql\Statement\Type\TypeDesignation packages/sql-semantics-postgres/src/Statement/Type/TypeDesignation.php:32
- type SqlSemantics\Platform\PostgreSql\Statement\Type\TypeName packages/sql-semantics-postgres/src/Statement/Type/TypeName.php:59