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

An option of the old COPY syntax that sets a string: DELIMITER, NULL, QUOTE, ESCAPE or ENCODING followed by a string constant.

The AS between the keyword and the string is optional. Source: https://www.postgresql.org/docs/17/sql-copy.html#id-1.9.3.55.10.

Reading a string optiondoctest
$copy = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("COPY t FROM STDIN NULL AS '-' ENCODING 'UTF8'");
    [$copy->statement->legacy[0]->value->value, $copy->statement->legacy[1]->option(), $copy->toString()] // => ['-', 'encoding', "COPY t FROM STDIN NULL '-' ENCODING 'UTF8'"]

Properties§

Methods§

public function __construct(public CopyTextKind $kind, public StringConstant $value)

Parameters

$kindCopyTextKindThe option set
$valueStringConstantThe string
public function option(): string

Answers the name of the generic option the item sets.

Returns

string
Calls 1
public function render(Output $out): void

Writes the keyword and the string.

Parameters

$outOutput
Calls 1

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 1