classDelete
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.
$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> $optionspublic list<OrderItem> $orderBypublic WithClause|null $withpublic WriteTarget $tablepublic Scalar|null $where = nullpublic Limit|null $limit = nullMethods§
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
$with | WithClause|null | The common tables (MySQL 8.0 and later) |
$options | list<DeleteOption> | The modifiers |
$table | WriteTarget | The table rows are deleted from |
$where | Scalar|null | The row predicate |
$orderBy | list<OrderItem> | The order the rows are deleted in |
$limit | Limit|null | The most rows deleted |
Calls 3
- static-call Check::listOf() line 59
- class-const DeleteOption::class() line 59
- class-const OrderItem::class() line 60
public function deriveStatement(Derivation $derivation): voidDerives the table and the clauses; the statement returns no rows.
Parameters
$derivation | Derivation |
Calls 3
- method-call ChangeFacts::delete() line 68
- new ChangeFacts line 68
- method-call Derivation::environment() line 68
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 2
- method-call Output::node() line 76
- method-call Output::keyword() line 78
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.