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

One option of the parenthesized COPY option list: a name and an optional argument.

Mirrors the DefElem of a COPY option. The argument is a word, a string, a number, a boolean, *, DEFAULT (PostgreSQL 17) or a parenthesized list. Source: https://www.postgresql.org/docs/17/sql-copy.html.

Reading the options of COPYdoctest
$copy = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("COPY t TO STDOUT (FORMAT csv, FORCE_QUOTE *, HEADER)");
    [$copy->statement->options[0]->name->value, $copy->statement->options[2]->argument, $copy->toString()] // => ['format', null, 'COPY t TO STDOUT (format csv, force_quote *, header)']

Properties§

public Name $name
public OptionArgument|null $argument = null

Methods§

public function __construct(public Name $name, public OptionArgument|null $argument = null)

Parameters

$nameNameThe option name
$argumentOptionArgument|nullThe argument: a boolean keyword, a word, a string, a number, DEFAULT, `*` or a list

Throws

InvalidConstruction When the argument is of another kind
Calls 1
public function render(Output $out): void

Writes the name and the argument.

Parameters

$outOutput
Calls 2

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Constant reads 2
Type declarations 2