classReferencedTableLookup
final class ReferencedTableLookup
Restricted visibility: declared "@visibility ZtdQuery\Platform\Sqlite". Code outside that scope must not name this declaration.
Checks statement relations against known shadow tables and views.
Methods§
public function __construct(
private SqliteCteShadowComposer $cteComposer,
private SqliteParser $parser,
private TableDefinitionRegistry $registry,
private ShadowStore $shadowStore,
private ViewDefinitionSet $views,
)Binds the collaborators used by this operation.
Parameters
$cteComposer | SqliteCteShadowComposer | |
$parser | SqliteParser | |
$registry | TableDefinitionRegistry | |
$shadowStore | ShadowStore | |
$views | ViewDefinitionSet |
public function findUnknownTable(string $sql): ?stringChecks statement relations against known shadow tables and views.
Parameters
$sql | string |
Returns
?stringTest cases 1
Called from 1
Calls 6
- method-call SqliteParser::classifyStatement() line 37
- method-call SqliteParser::extractSelectTables() line 42
- function-call
array_fill_keysline 43 - method-call SqliteCteShadowComposer::declaredCteNames() line 43
- function-call
strtolowerline 46 - method-call ReferencedTableLookup::tableExists() line 49
public function tableExists(string $tableName): boolChecks statement relations against known shadow tables and views.
Parameters
$tableName | string |
Returns
boolTest cases 1
Called from 1
Calls 4
- method-call ShadowStore::has() line 62
- method-call TableDefinitionRegistry::has() line 66
- method-call TableDefinitionRegistry::isRemoved() line 70
- method-call ViewDefinitionSet::has() line 74
public function hasSchemaContext(): boolChecks statement relations against known shadow tables and views.
Returns
boolTest cases 2
Called from 1
Calls 3
- method-call ShadowStore::getAll() line 86
- method-call TableDefinitionRegistry::hasAnyTables() line 90
- method-call ViewDefinitionSet::hasAnyViews() line 94
public function assertKnownTables(string $sql, string $originalSql): voidRejects unknown read sources only when a schema or fixture context exists.
Parameters
$sql | string | |
$originalSql | string |
Throws
Test cases 2
Called from 1
Calls 3
Private surface 5§
Implementation details, listed for orientation only.
private SqliteCteShadowComposer $cteComposerprivate SqliteParser $parserprivate TableDefinitionRegistry $registryprivate ShadowStore $shadowStoreprivate ViewDefinitionSet $viewsTest cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ReferencedTableLookupTest::testAssertKnownTablesPermitsQueriesBeforeFixtureRegistrationcallsReferencedTableLookupTest::testAssertKnownTablesRejectsUnknownSourcesWhenContextExistscallsReferencedTableLookupTest::testFindUnknownTableIgnoresUserCtesAndFindsUnknownJoinSourcescallsReferencedTableLookupTest::testHasSchemaContextIncludesViewscallsReferencedTableLookupTest::testTableExistsRecognizesEachSchemaStatecalls
Other tests reaching this symbol 3
SqliteRewriterTestcallsStatementRewriterTestcallsSqliteSessionFactoryTestcalls