classSqlState
final class SqlState
implements Condition
uses Snapshot
Public API: explicitly declared with
@visibility public.An SQLSTATE value: SQLSTATE [VALUE] 'xxxxx'.
The optional word VALUE carries no meaning and is not kept. A value that is not five digits or upper-case letters, or that begins with 00, is still structured; the statement that holds it reports it. Source: https://dev.mysql.com/doc/refman/8.4/en/declare-condition.html.
$text = new \SqlSemantics\Platform\MySql\Statement\Literal\Text('00000');
(new \SqlSemantics\Platform\MySql\Statement\Routine\Condition\SqlState($text))->valid() // => falseProperties§
public Text $stateMethods§
public function __construct(public Text $state)Parameters
$state | Text | The five characters of the value, written as a quoted string |
Calls 1
- static-call Check::input() line 34
public function valid(): boolTells whether the value has the form of an SQLSTATE that is not a success class.
Returns
boolTest cases 1
public function render(Output $out): voidWrites SQLSTATE and the value.
Parameters
$out | Output |
Test cases 1
Calls 1
- method-call Output::keyword() line 50
Test cases 17§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
Other tests reaching this symbol 12
ConditionRuleTest::testHandledLowersEveryKindOfConditioncallsConditionRuleTest::testValueLowersAnErrorCodeAndAnSqlstatecallsConditionRuleTest::testValueLowersTheSqlstateOfResignalcallsSignalRuleTest::providerStatementLowersResignalcallsSignalRuleTest::testConditionLowersAnSqlstateWithTheWordValuecallsSignalRuleTest::testStatementLowersSignalcallsBlockRuleTest::testDeclarationLowersAConditionAndAHandlercallsConditionFactsTest::providerSameComparesTheValuescallsProgramScopeTest::testConditionFindsTheInnermostDeclarationOfTheNamecallsConditionTest::testImplementationsAreTheValuesAHandlerNamescallsResignalTest::testDeriveStatementAcceptsAnSqlStateValueAndItsItemscallsSignalTest::testDeriveStatementAcceptsAnSqlStateValueAndItsItemscalls
Relations§
Instantiated in 1
Type checks 3
- instanceof SqlSemantics\Platform\MySql\Lowering\Routine\Condition\SignalRule::condition() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/SignalRule.php:97
- instanceof SqlSemantics\Platform\MySql\Rules\Routine\ConditionFacts::value() packages/sql-semantics-mysql/src/Rules/Routine/ConditionFacts.php:52
- instanceof SqlSemantics\Platform\MySql\Rules\Routine\ConditionFacts::same() packages/sql-semantics-mysql/src/Rules/Routine/ConditionFacts.php:76
Type declarations 6
- type SqlSemantics\Platform\MySql\Lowering\Routine\Condition\ConditionRule packages/sql-semantics-mysql/src/Lowering/Routine/Condition/ConditionRule.php:45
- type SqlSemantics\Platform\MySql\Lowering\Routine\Condition\SignalRule packages/sql-semantics-mysql/src/Lowering/Routine/Condition/SignalRule.php:89
- type SqlSemantics\Platform\MySql\Rules\Routine\ConditionFacts packages/sql-semantics-mysql/src/Rules/Routine/ConditionFacts.php:86
- type SqlSemantics\Platform\MySql\Statement\Routine\Condition\Resignal packages/sql-semantics-mysql/src/Statement/Routine/Condition/Resignal.php:42
- type SqlSemantics\Platform\MySql\Statement\Routine\Condition\Signal packages/sql-semantics-mysql/src/Statement/Routine/Condition/Signal.php:42
- type SqlSemantics\Platform\MySql\Statement\Routine\Program\ConditionDeclaration packages/sql-semantics-mysql/src/Statement/Routine/Program/ConditionDeclaration.php:33