final class Delete
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

DELETE from one table, with WHERE, ORDER BY and LIMIT.

The facts follow MYSQL-DELETE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/delete.html.

Reading a single-table DELETEdoctest
$delete = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('DELETE QUICK FROM t WHERE a = 1 ORDER BY b LIMIT 5');
    [$delete->statement->options, $delete->toString()] // => [[\SqlSemantics\Platform\MySql\Statement\Dml\DeleteOption::Quick], 'DELETE QUICK FROM t WHERE a = 1 ORDER BY b LIMIT 5']

Properties§

public list<DeleteOption> $options
public list<OrderItem> $orderBy
public WithClause|null $with
public WriteTarget $table
public Scalar|null $where = null
public Limit|null $limit = null

Methods§

public function __construct(
    public WithClause|null $with,
    list<DeleteOption> $options,
    public WriteTarget $table,
    public Scalar|null $where = null,
    list<OrderItem> $orderBy = [],
    public Limit|null $limit = null,
)

Parameters

$withWithClause|nullThe common tables (MySQL 8.0 and later)
$optionslist<DeleteOption>The modifiers
$tableWriteTargetThe table rows are deleted from
$whereScalar|nullThe row predicate
$orderBylist<OrderItem>The order the rows are deleted in
$limitLimit|nullThe most rows deleted
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives the table and the clauses; the statement returns no rows.

Parameters

$derivationDerivation
Calls 3
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 2

Test cases 3§

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 2

Relations§

Instantiated in 2
Type declarations 1