classBegin
final class Begin
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to start a transaction.
Rule: SQLITE-BEGIN-001. A start without a behavior word is deferred, as one with DEFERRED is; the model keeps which of the two was written. SQLite reads a name after TRANSACTION and ignores it. The statement reads no relation and returns no rows. Source: https://sqlite.org/lang_transaction.html. Status: Implemented.
$begin = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('BEGIN EXCLUSIVE TRANSACTION');
[$begin->statement->behavior?->value, $begin->toString()] // => ['EXCLUSIVE', 'BEGIN EXCLUSIVE']Properties§
public TransactionBehavior|null $behavior = nullpublic Name|null $name = nullMethods§
public function __construct(
public TransactionBehavior|null $behavior = null,
public Name|null $name = null,
)Parameters
$behavior | TransactionBehavior|null | The written behavior word; null requests the deferred default |
$name | Name|null | The name written after TRANSACTION, which SQLite ignores |
public function effectiveBehavior(): TransactionBehaviorAnswers the behavior the transaction starts with.
Returns
Test cases 2
Calls 1
- class-const TransactionBehavior::Deferred() line 45
public function deriveStatement(Derivation $derivation): voidDerives nothing: the request depends on no declaration.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 60
- class-const NameUse::Label() line 65
Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 5
DefinitionCommandsTest::testCommandLowersATransactionCommandcallsDefinitionCommandsTest::testExplainedWrapsTheCommandInTheWrittenRequestcallsTransactionRuleTest::testBehaviorKeepsTheWrittenWordAndItsAbsencecallsTransactionRuleTest::testCommandLowersEachTransactionCommandToItsOwnRequestcallsExplainTest::testRenderWritesANewlyBuiltRequestcalls