classRelationReader
final class RelationReader
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
Reads endpoints and optional relation groups from one statement.
Methods§
public function __construct(private RelationCursor $cursor)Reads from the supplied statement cursor.
Parameters
$cursor | RelationCursor |
public function parseStatement(): list<Relation>|stringA statement is either a bare table name or one relation, which expands to several when its target is a group.
Returns
list<Relation>|stringTest cases 1
Called from 1
Calls 9
- function-call
str_containsline 33 - method-call RelationCursor::readIdentifier() line 34
- method-call RelationCursor::expectEnd() line 35
- method-call RelationReader::readEndpoint() line 40
- method-call RelationCursor::skipWhitespace() line 41
- method-call RelationCursor::readOptionalMarker() line 43
- method-call RelationCursor::readOperator() line 44
- method-call RelationReader::readTargets() line 48
- method-call RelationReader::buildRelations() line 51
public function readTargets(): list<ColumnRef>Returns
list<ColumnRef>Test cases 1
Called from 1
Calls 4
- method-call RelationCursor::peek() line 62
- method-call RelationReader::readEndpoint() line 63
- method-call RelationCursor::skipWhitespace() line 70
- new UnexpectedPlanTokenException line 85
public function readEndpoint(): ColumnRefReads endpoint.
Returns
Test cases 1
Called from 3
- method-call SqlFixture\Plan\Parsing\RelationReader::parseStatement() packages/sql-fixture/src/Plan/Parsing/RelationReader.php:40
- method-call SqlFixture\Plan\Parsing\RelationReader::readTargets() packages/sql-fixture/src/Plan/Parsing/RelationReader.php:63
- method-call SqlFixture\Plan\Parsing\RelationReader::readTargets() packages/sql-fixture/src/Plan/Parsing/RelationReader.php:71
Calls 5
- method-call RelationCursor::readIdentifier() line 97
- method-call RelationCursor::peek() line 99
- new UnexpectedPlanTokenException line 100
- new ColumnRef line 105
- method-call RelationCursor::skipWhitespace() line 112
public function buildRelations(
ColumnRef $left,
RelationKind $kind,
list<ColumnRef> $targets,
bool $leftOptional,
bool $rightOptional,
): list<Relation>A grouped target expands to one relation per endpoint, so grouping is only ever a shorthand for repeating the left end.
Parameters
$left | ColumnRef | |
$kind | RelationKind | |
$targets | list<ColumnRef> | |
$leftOptional | bool | |
$rightOptional | bool |
Returns
list<Relation>Test cases 1
Called from 1
Private surface 1§
Implementation details, listed for orientation only.
private RelationCursor $cursorTest cases 34§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 30
PostgreSqlEndToEndTestcallsSqliteIntegrationTestcallsConnectedTablesTestcallsOverrideSpecsTestcallsRelationCountsTestcallsRelationProjectionTestcallsRowMaterializerTestcallsGenerationRunTestcallsPlanGeneratorTestcallsPlanSchemaExceptionTestcallsPlanSchemaValidatorTestcallsEndpointValidatorTestcallsFixtureProviderTestcallsConstructorHydrationTestcallsPropertyHydrationTestcallsColumnRefTestcallsFixturePlanTestcallsPlanStatementsTestcallsRelationCursorTestcallsPlanParserTestcallsPlanPrinterTestcallsPlanStructureExceptionTestcallsPlanSyntaxExceptionTestcallsPlanTablesTestcallsRelationGroupsTestcallsStatementPrinterTestcallsRelationTestcallsPlanValidationTestcallsTableNameTestcallsSqlSchemaProviderTestcalls