classRelationReference
final class RelationReference
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.A table named with or without its inheritance descendants, as relation_expr writes it.
Mirrors PostgreSQL's RangeVar name and inh flag. A table stands for itself and its descendant tables unless ONLY is written; a trailing * states the default explicitly and changes nothing. Source: https://www.postgresql.org/docs/17/sql-select.html#SQL-FROM.
$table = new \SqlSemantics\Platform\PostgreSql\Statement\Name\RelationReference(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('t')), true);
[$table->name->name->value, $table->only] // => ['t', true]Properties§
public QualifiedName $namepublic bool $only = falseMethods§
public function __construct(public QualifiedName $name, public bool $only = false)Parameters
$name | QualifiedName | The relation name |
$only | bool | Whether descendant tables are excluded |
public function render(Output $out): voidWrites ONLY when descendants are excluded, then the name.
Parameters
$out | Output |
Test cases 2
Calls 3
- method-call Output::keyword() line 44
- method-call Spelling::qualified() line 46
- new Spelling line 46
Test cases 39§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 37
CommonTableFactsTest::testBindMakesTheTablesVisiblecallsCommonTableFactsTest::testMarkIsTheCommonTypeOfTheValuescallsCommonTableFactsTest::testMemberReportsASearchColumnTheTableLackscallsCommonTableFactsTest::testOrderDerivesReferencedTablesFirstcallsCommonTableFactsTest::testRecursiveFormReportsAQueryWithoutUnioncallsCommonTableFactsTest::testShapeAddsTheSearchAndCycleColumnscallsCommonTableFactsTest::testUsesListsTheReadRelationscallsSetOperationFactsTest::testReboundBindsTheRecursiveTablecallsJoiningTest::testExtendedMakesEverySlotNullablecallsLateralReachTest::testBarMarksEveryRelationOncecallsLateralReachTest::testBarredTellsABarredRelationcallsLateralReachTest::testReachedFindsTheBarredRelationOfAQualifiercallsLateralReachTest::testReachedFindsTheBarredRelationOfAResolvedColumncallsTableShapesTest::testInputReportsASampleOfACommonTablecallsVisibilityTest::testAdmitsMatchesTheNameAndSchemacallsVisibilityTest::testQualifiedOnlyHidesEverySlotcallsVisibilityTest::testRestrictedTellsAQualifiedOnlyRelationcallsVisibilityTest::testStarSkipsQualifiedOnlyRelationscallsVisibilityTest::testUnhiddenSkipsHiddenSlotscallsVisibilityTest::testUnqualifiedDropsTheSystemColumnsOfQualifiedOnlyRelationscallsVisibilityTest::testUnqualifiedKeepsAnEnvironmentWithoutQualifiedOnlyRelationscallsObjectFormsTest::testFormNamesEachReferencecallsRelationTargetsTest::testRecordKeepsAnUndeclaredRelationOpencallsRelationsTargetTest::testObjectcallsRelationsTargetTest::testRejectsAnotherKindcallsRelationsTargetTest::testRejectsOnlycallsAlterPublicationMembersTest::testRejectsABareTableAfterASchemacallsCreatePublicationTest::testRejectsASchemaNameThatWouldReadAsATablecallsPublicationTableTest::testBareIsFalseForAStarcallsPublicationTableTest::testRejectsOnlyWithAStarcallsRelationTargetTest::testDeriveClauseRecordsNothingcallsRelationTargetTest::testRenderWritesOnlycallsRenameTest::testRejectsAPartOfAnotherKindcallsTableInputTest::testAliasIsTheCorrelationNamecallsTableInputTest::testNameIsTheRelationNamecallsAlterTableTest::testRefusesOnlyForAnIndexcallsCreateIndexTest::testRefusesIfNotExistsWithoutANamecalls
Relations§
Instantiated in 12
- new SqlSemantics\Platform\PostgreSql\Lowering\Access\GrantRule::target() packages/sql-semantics-postgres/src/Lowering/Access/GrantRule.php:127
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\PublicationRule::object() packages/sql-semantics-postgres/src/Lowering/Catalog/PublicationRule.php:106
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\PublicationRule::continued() packages/sql-semantics-postgres/src/Lowering/Catalog/PublicationRule.php:129
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CopyRule::copy() packages/sql-semantics-postgres/src/Lowering/Manipulation/CopyRule.php:65
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::target() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:134
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::target() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:135
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::relation() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:345
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::relation() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:347
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::relation() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:348
- new SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule::relation() packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:349
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:227
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\AlterTableRule::statement() packages/sql-semantics-postgres/src/Lowering/Table/AlterTableRule.php:98
Constant reads 4
- class-const SqlSemantics\Platform\PostgreSql\Statement\Catalog\Access\Target\RelationsTarget::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/Access/Target/RelationsTarget.php:51
- class-const SqlSemantics\Platform\PostgreSql\Statement\Catalog\ForeignData\ImportRestriction::__construct() packages/sql-semantics-postgres/src/Statement/Catalog/ForeignData/ImportRestriction.php:40
- class-const SqlSemantics\Platform\PostgreSql\Statement\Table\TruncateTable::__construct() packages/sql-semantics-postgres/src/Statement/Table/TruncateTable.php:52
- class-const SqlSemantics\Platform\PostgreSql\Statement\Utility\Maintenance\Lock::__construct() packages/sql-semantics-postgres/src/Statement/Utility/Maintenance/Lock.php:51
Type declarations 10
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:339
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\Queries packages/sql-semantics-postgres/src/Lowering/Query/Queries.php:116
- type SqlSemantics\Platform\PostgreSql\Rules\Access\GrantedRelations packages/sql-semantics-postgres/src/Rules/Access/GrantedRelations.php:48
- type SqlSemantics\Platform\PostgreSql\Rules\Access\GrantedRelations packages/sql-semantics-postgres/src/Rules/Access/GrantedRelations.php:74
- type SqlSemantics\Platform\PostgreSql\Statement\Catalog\Publication\PublicationTable packages/sql-semantics-postgres/src/Statement/Catalog/Publication/PublicationTable.php:54
- type SqlSemantics\Platform\PostgreSql\Statement\Manipulation\TargetTable packages/sql-semantics-postgres/src/Statement/Manipulation/TargetTable.php:40
- type SqlSemantics\Platform\PostgreSql\Statement\Object\Reference\RelationTarget packages/sql-semantics-postgres/src/Statement/Object/Reference/RelationTarget.php:34
- type SqlSemantics\Platform\PostgreSql\Statement\Relation\TableInput packages/sql-semantics-postgres/src/Statement/Relation/TableInput.php:49
- type SqlSemantics\Platform\PostgreSql\Statement\Table\Alter\AlterTable packages/sql-semantics-postgres/src/Statement/Table/Alter/AlterTable.php:50
- type SqlSemantics\Platform\PostgreSql\Statement\Table\Index\CreateIndex packages/sql-semantics-postgres/src/Statement/Table/Index/CreateIndex.php:75