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\MySql\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 1
Calls 1
- method-call Comparison::equal() line 86
Test cases 11§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 11
ConditionFactsTest::testMeaningAnswersTheDeclaredValueOfAConditionNamecallsProgramScopeTest::testConditionFindsTheInnermostDeclarationOfTheNamecallsProgramScopeTest::testDeclaredReplacesTheEnvironmentConditionsAndCursorscallsProgramScopeTest::testHandlerSeesNoLabelOutsideTheHandlercallsProgramScopeTest::testHoldsComparesNamesWithoutRegardToLetterCasecallsProgramScopeTest::testLabeledAddsTheLabelOfABlockOrALoopcallsProgramScopeTest::testLabeledKeepsTheScopeWithoutALabelcallsProgramScopeTest::testVariableIsFalseInAnEnvironmentWithoutVariablescallsRowAliasesTest::testSpellingsKeepsOneSpellingUnderCaseInsensitiveNamescallsRowAliasesTest::testSpellingsListsEveryLetterCaseUnderCaseSensitiveNamescallsShowTablesTest::testDeriveRelationNamesTheColumnAfterTheContextDatabasecalls
Relations§
Instantiated in 2
Method calls 1
Type checks 1
Type declarations 13
- type SqlSemantics\Platform\MySql\Model\Construction\Derivation packages/sql-semantics-mysql/src/Model/Construction/Derivation.php:69
- type SqlSemantics\Platform\MySql\Model\Construction\Derivation packages/sql-semantics-mysql/src/Model/Construction/Derivation.php:84
- type SqlSemantics\Platform\MySql\Model\Construction\Derivation packages/sql-semantics-mysql/src/Model/Construction/Derivation.php:98
- type SqlSemantics\Platform\MySql\Model\Resolution\Environment packages/sql-semantics-mysql/src/Model/Resolution/Environment.php:31
- type SqlSemantics\Platform\MySql\Model\Resolution\TableLookup packages/sql-semantics-mysql/src/Model/Resolution/TableLookup.php:35
- type SqlSemantics\Platform\MySql\Model\Statement\Operation packages/sql-semantics-mysql/src/Model/Statement/Operation.php:63
- type SqlSemantics\Platform\MySql\Model\Validation\Publication packages/sql-semantics-mysql/src/Model/Validation/Publication.php:46
- type SqlSemantics\Platform\MySql\Platform packages/sql-semantics-mysql/src/Platform.php:152
- type SqlSemantics\Platform\MySql\Rules\Routine\RowAliases packages/sql-semantics-mysql/src/Rules/Routine/RowAliases.php:37
- type SqlSemantics\Platform\MySql\Rules\Routine\RowAliases packages/sql-semantics-mysql/src/Rules/Routine/RowAliases.php:61
- type SqlSemantics\Platform\MySql\Rules\SessionDatabase packages/sql-semantics-mysql/src/Rules/SessionDatabase.php:36
- type SqlSemantics\Platform\MySql\Rules\TableChange\Targets packages/sql-semantics-mysql/src/Rules/TableChange/Targets.php:79
- type SqlSemantics\Platform\MySql\Semantics packages/sql-semantics-mysql/src/Semantics.php:106