classBegin
final class Begin
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.BEGIN or START TRANSACTION: a request to start a transaction block.
Rule: PG-TRANSACTION-001. Mirrors PostgreSQL's TransactionStmt of kind TRANS_STMT_BEGIN or TRANS_STMT_START with its mode options in the order written. WORK or TRANSACTION after BEGIN, and the commas between modes, have no effect and are not kept. Facts: none; whether a block is already open is the state of the session. Source: https://www.postgresql.org/docs/17/sql-begin.html, https://www.postgresql.org/docs/17/sql-start-transaction.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('BEGIN WORK ISOLATION LEVEL SERIALIZABLE, READ ONLY');
[count($operation->statement->modes), $operation->toString()] // => [2, 'BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY']Properties§
public list<TransactionMode> $modespublic BeginSpelling $spelling = BeginSpelling::BeginMethods§
public function __construct(
public BeginSpelling $spelling = BeginSpelling::Begin,
list<TransactionMode> $modes = [],
)Parameters
$spelling | BeginSpelling | The spelling of the command |
$modes | list<TransactionMode> | The characteristics in the order written |
Calls 3
- class-const BeginSpelling::Begin() line 41
- static-call Check::listOf() line 43
- class-const TransactionMode::class() line 43
public function deriveStatement(Derivation $derivation): voidDerives nothing: a transaction is the state of a session.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 58
- function-call
explodeline 58
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
BeginTestcalls
Other tests reaching this symbol 3
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:77
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:78