classLoadInput
final class LoadInput
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.What LOAD reads: [LOCAL] INFILE|URL|S3 'name' [COUNT n] [IN PRIMARY KEY ORDER].
LOCAL makes the client read the file. COUNT and IN PRIMARY KEY ORDER belong to the bulk load of the HeatWave grammars (8.0.30 and later) and tell how many files the name pattern matches and that they are sorted by primary key. The 8.4 and later grammars read the word COUNT as an identifier, which the server requires to be count in any letter case; that word is kept so it is written back the way the grammar reads it. Source: https://dev.mysql.com/doc/refman/8.4/en/load-data.html.
$load = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("LOAD DATA LOCAL INFILE 'f.csv' INTO TABLE t");
[$load->statement->input->local, $load->statement->input->source, $load->statement->input->file->value] // => [true, \SqlSemantics\Platform\MySql\Statement\Dml\Load\LoadSource::Infile, 'f.csv']Properties§
public bool $localpublic LoadSource $sourcepublic Text $filepublic Numeral|null $count = nullpublic bool $primaryKeyOrder = falsepublic Name|null $countWord = nullMethods§
public function __construct(
public bool $local,
public LoadSource $source,
public Text $file,
public Numeral|null $count = null,
public bool $primaryKeyOrder = false,
public Name|null $countWord = null,
)Parameters
$local | bool | Whether the client reads the file |
$source | LoadSource | The kind of location |
$file | Text | The file name, URL or pattern |
$count | Numeral|null | The number of files |
$primaryKeyOrder | bool | Whether the files are sorted by primary key |
$countWord | Name|null | The word COUNT when the grammar reads it as an identifier (8.4 and later), which may be quoted; null for the keyword |
Throws
InvalidConstruction When the word COUNT is given without a count or is another wordCalls 2
- static-call Check::input() line 54
- function-call
strcasecmpline 54
public function render(Output $out): voidWrites the input.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 63
- method-call Output::name() line 67
- class-const NameUse::Label() line 67
- method-call Output::node() line 71
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::input() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:196
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::input() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:200
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::input() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:210