classCopyOptionRule
final class CopyOptionRule
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 options(Node $options): array{list<CopyFlag|CopyText|CopyForce>, list<CopyOption>}Lowers copy_options: the options of the old syntax and the parenthesized options, one of them empty.
Parameters
$options | Node |
Returns
array{list<CopyFlag|CopyText|CopyForce>, list<CopyOption>}Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CopyRule::copy() packages/sql-semantics-postgres/src/Lowering/Manipulation/CopyRule.php:54
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CopyRule::copy() packages/sql-semantics-postgres/src/Lowering/Manipulation/CopyRule.php:61
Calls 4
- method-call Lowering::items() line 91
- method-call CopyOptionRule::option() line 92
- static-call ImplementationGap::production() line 98
- method-call CopyOptionRule::item() line 102
Lowers copy_opt_item.
Parameters
$item | Node |
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- class-const CopyOptionRule::FLAGS() line 116
- class-const CopyOptionRule::TEXTS() line 119
- new CopyText line 122
- class-const CopyOptionRule::FORCES() line 124
- static-call ImplementationGap::production() line 125
- new CopyForce line 129
public function option(Node $element): CopyOptionLowers copy_generic_opt_elem.
Parameters
$element | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- static-call ImplementationGap::production() line 141
- new CopyOption line 144
- method-call CopyOptionRule::argument() line 144
public function argument(Node $argument): ?OptionArgumentLowers copy_generic_opt_arg; no argument is null.
Parameters
$argument | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 5
- new CopyAllColumns line 159
- new KeywordWord line 160
- new Name line 160
- method-call CopyOptionRule::arguments() line 161
- static-call ImplementationGap::production() line 163
public function arguments(Node $list): CopyArgumentsLowers copy_generic_opt_arg_list.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When an item has no ruleCalled from 1
Calls 3
- method-call Lowering::items() line 175
- static-call ImplementationGap::production() line 178
- new CopyArguments line 183
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 $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CopyOptionRuleTestcalls
Relations§
Instantiated in 1
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CopyRule::copy() packages/sql-semantics-postgres/src/Lowering/Manipulation/CopyRule.php:54
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CopyRule::copy() packages/sql-semantics-postgres/src/Lowering/Manipulation/CopyRule.php:61