classMemberName
final class MemberName
implements ObjectReference
uses Snapshot
@visibility public.An object named within the table or domain it belongs to: name ON table or name ON DOMAIN domain.
Policies, rules, triggers and table constraints are named per table, and domain constraints per domain. DROP and COMMENT write the owner as a dotted name of any length, ALTER ... RENAME and DEPENDS ON EXTENSION as a relation name of at most three parts; the form is kept. Source: https://www.postgresql.org/docs/17/sql-droptrigger.html, https://www.postgresql.org/docs/17/sql-comment.html.
$member = new \SqlSemantics\Platform\PostgreSql\Statement\Object\Reference\MemberName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('audit'), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\QualifiedName(new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('orders')));
[$member->name->value, $member->table()?->name->value] // => ['audit', 'orders']Properties§
public Name $namepublic DottedName|QualifiedName $ownerpublic bool $domain = falseMethods§
public function __construct(
public Name $name,
public DottedName|QualifiedName $owner,
public bool $domain = false,
)Parameters
$name | Name | The object name |
$owner | DottedName|QualifiedName | The table or domain the object belongs to |
$domain | bool | Whether the owner is a domain, written ON DOMAIN |
public function table(): ?QualifiedNameAnswers the owning table as a relation name, or null when the owner is a domain or has more than three parts.
Returns
Test cases 1
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: names hold no expression.
Parameters
$derivation | Derivation | |
$environment | Environment |
Test cases 1
public function render(Output $out): voidWrites the name, ON, DOMAIN when the owner is a domain, and the owner.
Parameters
$out | Output |
Test cases 1
Calls 6
- method-call Output::name() line 69
- class-const NameUse::Column() line 69
- method-call Output::keyword() line 71
- method-call Spelling::qualified() line 74
- new Spelling line 74
- method-call Output::node() line 78
Test cases 6§
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 3
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\DropRule::generic() packages/sql-semantics-postgres/src/Lowering/Routine/DropRule.php:112
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::named() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:146
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::keyed() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:176
- new SqlSemantics\Platform\PostgreSql\Lowering\Routine\ObjectRule::altered() packages/sql-semantics-postgres/src/Lowering/Routine/ObjectRule.php:216
Type checks 2
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Routine\ObjectForms::form() packages/sql-semantics-postgres/src/Rules/Routine/ObjectForms.php:90
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Routine\RelationTargets::resolve() packages/sql-semantics-postgres/src/Rules/Routine/RelationTargets.php:70