deno.land / x / pg_mem@2.8.1 / execution / schema-amends / alter-sequence.ts

alter-sequence.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
import { _ISchema, _Transaction, _ISequence, _IStatementExecutor, _IStatement, asSeq } from '../../interfaces-private.ts';import { AlterSequenceStatement } from 'https://deno.land/x/pgsql_ast_parser@12.0.1/mod.ts';import { ExecHelper } from '../exec-utils.ts';import { ignore } from '../../utils.ts';
export class AlterSequence extends ExecHelper implements _IStatementExecutor { private seq: _ISequence | null;

constructor({ schema }: _IStatement, private p: AlterSequenceStatement) { super(p);
this.seq = asSeq(schema.getObject(p.name, { nullIfNotFound: p.ifExists, })); if (!this.seq) { ignore(this.p); } }
execute(t: _Transaction) { // commit pending data before making changes // (because the index sequence creation does support further rollbacks) t = t.fullCommit();
// alter the sequence this.seq?.alter(t, this.p.change);
// new implicit transaction t = t.fork();
return this.noData(t, 'ALTER'); }}
pg_mem

Version Info

Tagged at
a year ago