LoadData
extends Statement
in package
Uses
Set
Class LoadData.
Tags
Table of Contents
- OPT_CONCURRENT = 'CONCURRENT'
- OPT_LOCAL = 'LOCAL'
- OPT_LOW_PRIORITY = 'LOW_PRIORITY'
- $database : Database
- $sql : array<string|int, mixed>
- SQL clauses and parts.
- __construct() : mixed
- Statement constructor.
- __toString() : string
- charset() : static
- columnsEnclosedBy() : static
- columnsEscapedBy() : static
- columnsTerminatedBy() : static
- ignoreLines() : static
- infile() : static
- intoTable() : static
- linesStartingBy() : static
- linesTerminatedBy() : static
- options() : static
- Sets the statement options.
- reset() : static
- Resets SQL clauses and parts.
- run() : int|string
- set() : static
- Sets the SET clause.
- sql() : string
- hasOptions() : bool
- Tells if the statement has options set.
- hasSet() : bool
- Tells if the SET clause was set.
- renderAliasedIdentifier() : string
- Renders a column part with an optional alias name, AS clause.
- renderAssignment() : string
- Renders an assignment part.
- renderCharset() : string|null
- renderColumns() : string|null
- renderIdentifier() : string
- Renders a column part.
- renderIgnoreLines() : string|null
- renderInfile() : string
- renderIntoTable() : string
- renderLimit() : string|null
- Renders the LIMIT clause.
- renderLines() : string|null
- renderOptions() : string|null
- renderSet() : string|null
- Renders the SET clause.
- renderSetCheckingConflicts() : string|null
- Renders the SET clause checking conflicts.
- renderValue() : float|int|string
- Renders a subquery or quote a value.
- setLimit() : static
- Sets the LIMIT clause.
- subquery() : string
- Returns an SQL part between parentheses.
Constants
OPT_CONCURRENT
public
string
OPT_CONCURRENT
= 'CONCURRENT'
Tags
OPT_LOCAL
public
string
OPT_LOCAL
= 'LOCAL'
Tags
OPT_LOW_PRIORITY
public
string
OPT_LOW_PRIORITY
= 'LOW_PRIORITY'
Tags
Properties
$database
protected
Database
$database
$sql
SQL clauses and parts.
protected
array<string|int, mixed>
$sql
= []
Methods
__construct()
Statement constructor.
public
__construct(Database $database) : mixed
Parameters
- $database : Database
Return values
mixed —__toString()
public
__toString() : string
Return values
string —charset()
public
charset(string $charset) : static
Parameters
- $charset : string
Tags
Return values
static —columnsEnclosedBy()
public
columnsEnclosedBy(string $char[, bool $optionally = false ]) : static
Parameters
- $char : string
- $optionally : bool = false
Return values
static —columnsEscapedBy()
public
columnsEscapedBy(string $char) : static
Parameters
- $char : string
Return values
static —columnsTerminatedBy()
public
columnsTerminatedBy(string $str) : static
Parameters
- $str : string
Return values
static —ignoreLines()
public
ignoreLines(int $number) : static
Parameters
- $number : int
Return values
static —infile()
public
infile(string $filename) : static
Parameters
- $filename : string
Return values
static —intoTable()
public
intoTable(string $table) : static
Parameters
- $table : string
Return values
static —linesStartingBy()
public
linesStartingBy(string $str) : static
Parameters
- $str : string
Return values
static —linesTerminatedBy()
public
linesTerminatedBy(string $str) : static
Parameters
- $str : string
Return values
static —options()
Sets the statement options.
public
options(string $option, string ...$options) : static
Parameters
- $option : string
-
One of the OPT_* constants
- $options : string
-
Each option value must be one of the OPT_* constants
Return values
static —reset()
Resets SQL clauses and parts.
public
reset([string|null $sql = null ]) : static
Parameters
- $sql : string|null = null
-
A part name or null to reset all
Tags
Return values
static —run()
public
run() : int|string
Return values
int|string —set()
Sets the SET clause.
public
set(array<string, \Closure|float|int|string|null>|object $columns) : static
Parameters
- $columns : array<string, \Closure|float|int|string|null>|object
-
Array of columns => values or an object to be cast to array
Return values
static —sql()
public
sql() : string
Return values
string —hasOptions()
Tells if the statement has options set.
protected
hasOptions() : bool
Return values
bool —hasSet()
Tells if the SET clause was set.
protected
hasSet() : bool
Return values
bool —True if was set, otherwise false
renderAliasedIdentifier()
Renders a column part with an optional alias name, AS clause.
protected
renderAliasedIdentifier(array<string, \Closure|string>|Closure|string $column) : string
Parameters
- $column : array<string, \Closure|string>|Closure|string
-
The column name, a subquery or an array where the index is the alias and the value is the column/subquery
Return values
string —renderAssignment()
Renders an assignment part.
protected
renderAssignment(string $identifier, Closure|float|int|string|null $expression) : string
Parameters
- $identifier : string
-
Identifier/column name
- $expression : Closure|float|int|string|null
-
Expression/value
Tags
Return values
string —renderCharset()
protected
renderCharset() : string|null
Return values
string|null —renderColumns()
protected
renderColumns() : string|null
Return values
string|null —renderIdentifier()
Renders a column part.
protected
renderIdentifier(Closure|string $column) : string
Parameters
- $column : Closure|string
-
The column name or a subquery
Return values
string —renderIgnoreLines()
protected
renderIgnoreLines() : string|null
Return values
string|null —renderInfile()
protected
renderInfile() : string
Return values
string —renderIntoTable()
protected
renderIntoTable() : string
Return values
string —renderLimit()
Renders the LIMIT clause.
protected
renderLimit() : string|null
Return values
string|null —renderLines()
protected
renderLines() : string|null
Return values
string|null —renderOptions()
protected
renderOptions() : string|null
Return values
string|null —renderSet()
Renders the SET clause.
protected
renderSet() : string|null
Return values
string|null —The SET clause null if it was not set
renderSetCheckingConflicts()
Renders the SET clause checking conflicts.
protected
renderSetCheckingConflicts() : string|null
Tags
Return values
string|null —The SET part or null if it was not set
renderValue()
Renders a subquery or quote a value.
protected
renderValue(Closure|float|int|string|null $value) : float|int|string
Parameters
- $value : Closure|float|int|string|null
-
A Closure for subquery, other types to quote
Return values
float|int|string —setLimit()
Sets the LIMIT clause.
protected
setLimit(int $limit[, int|null $offset = null ]) : static
Parameters
- $limit : int
- $offset : int|null = null
Tags
Return values
static —subquery()
Returns an SQL part between parentheses.
protected
subquery(Closure $subquery) : string
Parameters
- $subquery : Closure
-
A Closure having the current Manipulation instance as first argument. The returned value must be scalar