final class XmlColumnOption
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

One option of an XMLTABLE column: its path, its default, or whether it can be NULL.

Mirrors the DefElem options PostgreSQL's grammar builds for xmltable_column_option_el. Source: https://www.postgresql.org/docs/17/functions-xml.html#FUNCTIONS-XML-PROCESSING-XMLTABLE.

Reading an option written as an identifierdoctest
$option = new \SqlSemantics\Platform\PostgreSql\Statement\Relation\Xml\XmlColumnOption(\SqlSemantics\Platform\PostgreSql\Statement\Relation\Xml\XmlColumnOptionKind::Named, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\Constant(new \SqlSemantics\Platform\PostgreSql\Statement\Literal\StringConstant('a')), new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('path'));
    $option->word->value // => 'path'
Refusing a value for NOT NULLdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Relation\Xml\XmlColumnOption(\SqlSemantics\Platform\PostgreSql\Statement\Relation\Xml\XmlColumnOptionKind::NotNull, new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

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

Methods§

public function __construct(
    public XmlColumnOptionKind $kind,
    public Scalar|null $value = null,
    public Name|null $word = null,
)

Parameters

$kindXmlColumnOptionKindThe option
$valueScalar|nullThe value of PATH, DEFAULT or a named option, an expression of the restricted form `b_expr`
$wordName|nullThe identifier a named option is written with
Calls 5
public function render(Output $out): void

Writes the option.

Parameters

$outOutput
Calls 5

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 5
Constant reads 1