classCopyText
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.
$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§
public CopyTextKind $kindpublic StringConstant $valueMethods§
public function __construct(public CopyTextKind $kind, public StringConstant $value)Parameters
$kind | CopyTextKind | The option set |
$value | StringConstant | The string |
public function option(): stringAnswers the name of the generic option the item sets.
Returns
stringCalls 1
- function-call
strtolowerline 40
public function render(Output $out): voidWrites the keyword and the string.
Parameters
$out | Output |
Calls 1
- method-call Output::keyword() line 48
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CopyTextTestcalls
Relations§
Instantiated in 1
Constant reads 2
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyQuery::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyQuery.php:59
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Copy\CopyTable::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Copy/CopyTable.php:85