final class XmlAttribute
    implements Clause
    uses Snapshot
Public API: explicitly declared with @visibility public.

A value of XMLATTRIBUTES or XMLFOREST, optionally named with AS.

Mirrors the ResTarget the grammar builds for xml_attribute_el. An unnamed value takes the name of the column it references. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-PRODUCING-XML-XMLELEMENT.

Reading a named attributedoctest
$attribute = new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlAttribute(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('id'));
    $attribute->name->value // => 'id'

Properties§

public Scalar $value
public Name|null $name = null

Methods§

public function __construct(public Scalar $value, public Name|null $name = null)

Parameters

$valueScalarThe value
$nameName|nullThe name written after AS
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the value.

Parameters

$derivationDerivation
$environmentEnvironment
Test cases 1
Calls 1
public function render(Output $out): void

Writes the value and the name.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 9§

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 7

Relations§

Instantiated in 2
Constant reads 2