final class CopyOptionRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Lowers the options of COPY.

Rule: PG-COPY-OPTION-LOWER-001. Scope: copy_options, copy_opt_list, copy_opt_item, copy_generic_opt_list, copy_generic_opt_elem, copy_generic_opt_arg, copy_generic_opt_arg_list, copy_generic_opt_arg_list_item. Constructors: CopyFlag, CopyText, CopyForce, CopyOption, CopyAllColumns, CopyArguments. AS between an old-syntax keyword and its string is a noise word. DEFAULT as an argument (PostgreSQL 17) is the keyword word default. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-copy.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function options(Node $options): array{list<CopyFlag|CopyText|CopyForce>, list<CopyOption>}
public function argument(Node $argument): ?OptionArgument

Private surface 4§

Implementation details, listed for orientation only.

private const FLAGS = ['copy_opt_item: BINARY' => \SqlSemantics\Platform\PostgreSql\Statement\Manipul…
private const TEXTS = ['copy_opt_item: DELIMITER opt_as Sconst' => [\SqlSemantics\Platform\PostgreSql…
private const FORCES = ['copy_opt_item: FORCE QUOTE columnList' => [\SqlSemantics\Platform\PostgreSql\…
private Lowering $lowering

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
Method calls 2