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.

Reading the input of LOAD DATAdoctest
$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 $local
public LoadSource $source
public Text $file
public Numeral|null $count = null
public bool $primaryKeyOrder = false
public Name|null $countWord = null

Methods§

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

$localboolWhether the client reads the file
$sourceLoadSourceThe kind of location
$fileTextThe file name, URL or pattern
$countNumeral|nullThe number of files
$primaryKeyOrderboolWhether the files are sorted by primary key
$countWordName|nullThe 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 word
Calls 2
public function render(Output $out): void

Writes the input.

Parameters

$outOutput
Calls 4

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
Type declarations 2