classFieldOption
final class FieldOption
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One option of the FIELDS clause of a text file format: TERMINATED BY, [OPTIONALLY] ENCLOSED BY or ESCAPED BY a string.
Source: https://dev.mysql.com/doc/refman/8.4/en/load-data.html.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT 1 INTO OUTFILE 'f' FIELDS TERMINATED BY ','");
[$query->statement->into->format->fields[0]->kind, $query->statement->into->format->fields[0]->text->value] // => [\SqlSemantics\Platform\MySql\Statement\Dml\Load\FieldOptionKind::Terminated, ',']Properties§
public FieldOptionKind $kindpublic Text $textMethods§
public function __construct(public FieldOptionKind $kind, public Text $text)Parameters
$kind | FieldOptionKind | What the option sets |
$text | Text | The string it sets |
public function render(Output $out): voidWrites the option.
Parameters
$out | Output |
Test cases 1
Calls 2
- class-const FieldOptionKind::OptionallyEnclosed() line 39
- method-call Output::keyword() line 40
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
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Load\LoadTable::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Load/LoadTable.php:95
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Load\TextFileFormat::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Load/TextFileFormat.php:48