classXmlForest
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.
(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> $elementsMethods§
public function __construct(list<XmlAttribute> $elements)Parameters
$elements | list<XmlAttribute> | The values and their element names; at least one |
Calls 2
- static-call Check::listOf() line 49
- class-const XmlAttribute::class() line 49
public function outputName(): NameNames an unaliased result column.
Returns
Test cases 1
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the values, reports unnamed values, and derives the type and NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 8
- method-call Derivation::scalar() line 67
- method-call XmlChecks::elements() line 69
- new XmlChecks line 69
- new ScalarFact line 71
- new Known line 71
- class-const Builtin::Xml() line 71
- method-call Coalescing::nullability() line 71
- new Coalescing line 71
public function render(Output $out): voidWrites XMLFOREST with the values.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 79
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.