classFormatRule
final class FormatRule
Lowers the text file format of LOAD DATA and SELECT ... INTO OUTFILE.
Rule: MYSQL-DML-FORMAT-001. Scope: opt_load_data_charset, opt_field_term, field_term_list, field_term, opt_line_term, line_term_list, line_term. The options are kept in written order (FieldOption, LineOption); the keyword FIELDS is the lexer's COLUMNS. Terminates: lists are flattened by MYSQL-DML-LIST-001. Source: https://dev.mysql.com/doc/refman/8.4/en/load-data.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function charset(Node $charset): ?CharsetNameLowers the character set clause: a node of opt_load_data_charset; an absent clause is null.
Parameters
$charset | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
Calls 2
- method-call Lowering::form() line 57
- static-call ImplementationGap::production() line 62
public function fields(Node $clause): list<FieldOption>Lowers the FIELDS clause: a node of opt_field_term; an absent clause is empty.
Parameters
$clause | Node |
Returns
list<FieldOption>Throws
ImplementationGap When a production has no ruleCalled from 2
Calls 7
- method-call Lowering::form() line 77
- static-call ImplementationGap::production() line 82
- method-call ListRule::items() line 85
- new ListRule line 85
- class-const FormatRule::FIELDS() line 87
- new FieldOption line 88
- function-call
countline 88
public function lines(Node $clause): list<LineOption>Lowers the LINES clause: a node of opt_line_term; an absent clause is empty.
Parameters
$clause | Node |
Returns
list<LineOption>Throws
ImplementationGap When a production has no ruleCalled from 2
Calls 6
- method-call Lowering::form() line 102
- static-call ImplementationGap::production() line 107
- method-call ListRule::items() line 110
- new ListRule line 110
- class-const FormatRule::LINES() line 112
- new LineOption line 113
Private surface 3§
Implementation details, listed for orientation only.
private const FIELDS = ['field_term: TERMINATED BY text_string' => \SqlSemantics\Platform\MySql\Statem…private const LINES = ['line_term: TERMINATED BY text_string' => \SqlSemantics\Platform\MySql\Stateme…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
FormatRuleTestcalls
Relations§
Instantiated in 2
Method calls 6
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::fileFormat() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::fileFormat() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::fileFormat() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:115
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:118
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:119