classCopyArguments
final class CopyArguments
implements OptionArgument
uses Snapshot
Public API: explicitly declared with
@visibility public.A parenthesized list of words or strings as the argument of a COPY option, such as the columns of force_null.
Mirrors the List argument of a COPY DefElem. Source: https://www.postgresql.org/docs/17/sql-copy.html.
$copy = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("COPY t FROM STDIN (format csv, force_null (a, 'b'))");
count($copy->statement->options[1]->argument->items) // => 2new \SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyArguments([]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public non-empty-list<Toggle|Word|StringConstant> $itemsMethods§
public function __construct(list<OptionArgument> $items)Parameters
$items | list<OptionArgument> | The items in written order: at least one word, string or boolean keyword |
Throws
InvalidConstruction When there is no item, or an item is not a word, a string or a boolean keywordCalls 5
- method-call ClosedList::of() line 47
- new ClosedList line 47
- class-const Toggle::class() line 47
- class-const Word::class() line 47
- class-const StringConstant::class() line 47
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives nothing: the items are words and strings.
Parameters
$derivation | Derivation | |
$environment | Environment |
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CopyArgumentsTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 1
Type checks 2
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\CopyOptions::listed() packages/sql-semantics-postgres/src/Rules/Manipulation/CopyOptions.php:102
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyOption::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyOption.php:47