deno.land / x / pg_mem@2.8.1 / execution / transaction-statements.ts

transaction-statements.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { _IStatementExecutor, _Transaction, StatementResult } from '../interfaces-private.ts';import { ExecHelper } from './exec-utils.ts';import { CommitStatement, RollbackStatement, StartTransactionStatement, BeginStatement } from 'https://deno.land/x/pgsql_ast_parser@12.0.1/mod.ts';import { ignore } from '../utils.ts';
export class CommitExecutor extends ExecHelper implements _IStatementExecutor {
constructor(statement: CommitStatement) { super(statement) }
execute(t: _Transaction): StatementResult { t = t.commit(); // recreate an implicit transaction if we're at root // (I can see how its usfull, but this is dubious...) if (!t.isChild) { t = t.fork(); } return this.noData(t, 'COMMIT'); }
}
export class RollbackExecutor extends ExecHelper implements _IStatementExecutor { constructor(statement: RollbackStatement) { super(statement); ignore(statement); }
execute(t: _Transaction): StatementResult { t = t.rollback(); return this.noData(t, 'ROLLBACK'); }}

export class BeginStatementExec extends ExecHelper implements _IStatementExecutor { constructor(statement: BeginStatement | StartTransactionStatement) { super(statement); ignore(statement); }
execute(t: _Transaction): StatementResult { t = t.fork(); return this.noData(t, 'BEGIN'); }}
pg_mem

Version Info

Tagged at
4 months ago