classFieldSelection
final class FieldSelection
implements IndirectionStep
uses Snapshot
Public API: explicitly declared with
@visibility public.The indirection step .name: the selection of a field, or a further part of a dotted name.
Source: https://www.postgresql.org/docs/17/sql-expressions.html#FIELD-SELECTION.
(new \SqlSemantics\Platform\PostgreSql\Statement\Expression\FieldSelection(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('city')))->name->value // => 'city'Properties§
public Name $nameMethods§
public function field(): NameAnswers the field name.
Returns
Test cases 1
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: a field name holds no expression.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
public function render(Output $out): voidWrites the dot and the field name.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::symbol() line 54
- class-const NameUse::Label() line 54
Test cases 12§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 9
ExpressionsTest::testIndirectionLowersStepsInOrdercallsSubscriptingTest::testFieldReadsTheSlotOfACompositecallsTriggerReferencesTest::testSelectedReadsAFieldOfTheWholeRowAsAColumncallsIndirectionStepTest::testFieldIsOfferedByAFieldSelectioncallsIndirectionTest::testDeriveScalarSelectsAFieldOfARowcallsIndirectionTest::testOutputNameIsTheLastSelectedFieldcallsIndirectionTest::testRejectsABaseTheGrammarDoesNotIndirectcallsIndirectionTest::testRejectsAFieldStepRightAfterADottedNamecallsIndirectionTest::testRenderWritesTheBaseAndTheStepscalls
Relations§
Instantiated in 1
Type checks 4
- instanceof SqlSemantics\Platform\PostgreSql\Lowering\Expression\PrimaryRule::columnReference() packages/sql-semantics-postgres/src/Lowering/Expression/PrimaryRule.php:113
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\Subscripting::apply() packages/sql-semantics-postgres/src/Rules/Expression/Typing/Subscripting.php:68
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Expression\Typing\Subscripting::apply() packages/sql-semantics-postgres/src/Rules/Expression/Typing/Subscripting.php:78
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Command\TriggerReferences::selected() packages/sql-semantics-postgres/src/Rules/Table/Command/TriggerReferences.php:114