final class XmlForest
    implements Scalar, OutputNaming
    uses Snapshot
Public API: explicitly declared with @visibility public.

XMLFOREST (values): a sequence of XML elements, one per value.

Mirrors PostgreSQL's XmlExpr of kind IS_XMLFOREST. Rule: PG-XMLFOREST-001. Facts: xml; NULL values are omitted (PG-COALESCING-NULL-001). Diagnostics: an unnamed value that is not a column reference (PG-XML-CHECKS-001). The result column is named xmlforest. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-PRODUCING-XML-XMLFOREST. Status: Implemented.

Naming the result columndoctest
(new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlForest([new \SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlAttribute(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral(), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('a'))]))->outputName()->value // => 'xmlforest'

Properties§

public non-empty-list<XmlAttribute> $elements

Methods§

public function __construct(list<XmlAttribute> $elements)

Parameters

$elementslist<XmlAttribute>The values and their element names; at least one
Calls 2
public function outputName(): Name

Names an unaliased result column.

Returns

Test cases 1
Calls 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the values, reports unnamed values, and derives the type and NULL fact.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 8
public function render(Output $out): void

Writes XMLFOREST with the values.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4

Relations§

Instantiated in 1