final class ConditionDeclaration
    implements Declaration
    uses Snapshot
Public API: explicitly declared with @visibility public.

DECLARE ... CONDITION: a name for an error code or an SQLSTATE value.

Source: https://dev.mysql.com/doc/refman/8.4/en/declare-condition.html.

Reading a named conditiondoctest
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("CREATE PROCEDURE p() BEGIN DECLARE gone CONDITION FOR SQLSTATE '42S02'; END");
    $declaration = $create->statement->body->declarations[0];
    [$declaration->name->value, $declaration->value->state->value] // => ['gone', '42S02']

Properties§

public Name $name

Methods§

public function __construct(public Name $name, public ErrorCode|SqlState $value)

Parameters

$nameNameThe condition name
$valueErrorCode|SqlStateThe error code or SQLSTATE value the name stands for
public function render(Output $out): void

Writes the declaration.

Parameters

$outOutput
Calls 2

Test cases 10§

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 9

Relations§

Instantiated in 1
Type checks 1
Type declarations 1