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

DELETE from several tables: the tables rows are deleted from, the table references that find the rows, and WHERE.

Each table to delete from names a table of the references, by its correlation name when it has one. The facts follow MYSQL-DELETE-001. Source: https://dev.mysql.com/doc/refman/8.4/en/delete.html.

Reading a multiple-table DELETEdoctest
$delete = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('DELETE t.* , u FROM t JOIN u ON t.a = u.a WHERE t.b = 1');
    [count($delete->statement->targets), $delete->toString()] // => [2, 'DELETE t, u FROM t JOIN u ON t.a = u.a WHERE t.b = 1']

Properties§

public list<DeleteOption> $options
public list<QualifiedName> $targets
public list<Relation> $tables
public WithClause|null $with
public Scalar|null $where = null

Methods§

public function __construct(
    public WithClause|null $with,
    list<DeleteOption> $options,
    list<QualifiedName> $targets,
    public MultipleDeleteForm $form,
    list<Relation> $tables,
    public Scalar|null $where = null,
)

Parameters

$withWithClause|nullThe common tables (MySQL 8.0 and later)
$optionslist<DeleteOption>The modifiers
$targetslist<QualifiedName>The tables rows are deleted from; at least one
$formMultipleDeleteFormWhere the tables to delete from are written
$tableslist<Relation>The table references; at least one
$whereScalar|nullThe row predicate

Throws

InvalidConstruction When there is no table to delete from or no table reference
Calls 5
public function deriveStatement(Derivation $derivation): void

Derives the table references, the tables to delete from and WHERE; the statement returns no rows.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 7

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 3
Type declarations 1