drizzle-sybase 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -6
- package/dist/columns/index.d.ts +186 -36
- package/dist/columns/index.d.ts.map +1 -1
- package/dist/columns/index.js +113 -23
- package/dist/columns/index.js.map +1 -1
- package/dist/connection.d.ts +77 -157
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +244 -506
- package/dist/connection.js.map +1 -1
- package/dist/datetime.d.ts +15 -0
- package/dist/datetime.d.ts.map +1 -1
- package/dist/datetime.js +25 -0
- package/dist/datetime.js.map +1 -1
- package/dist/db.d.ts +36 -10
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +15 -25
- package/dist/db.js.map +1 -1
- package/dist/dialect.d.ts +24 -0
- package/dist/dialect.d.ts.map +1 -1
- package/dist/dialect.js +63 -9
- package/dist/dialect.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/introspect/codegen.d.ts +8 -1
- package/dist/introspect/codegen.d.ts.map +1 -1
- package/dist/introspect/codegen.js +117 -29
- package/dist/introspect/codegen.js.map +1 -1
- package/dist/introspect/fetch.d.ts +9 -2
- package/dist/introspect/fetch.d.ts.map +1 -1
- package/dist/introspect/fetch.js +37 -8
- package/dist/introspect/fetch.js.map +1 -1
- package/dist/introspect/index.d.ts +1 -0
- package/dist/introspect/index.d.ts.map +1 -1
- package/dist/introspect/index.js +8 -5
- package/dist/introspect/index.js.map +1 -1
- package/dist/introspect/type-map.d.ts +17 -8
- package/dist/introspect/type-map.d.ts.map +1 -1
- package/dist/introspect/type-map.js +28 -9
- package/dist/introspect/type-map.js.map +1 -1
- package/dist/native/index.d.ts +4 -1
- package/dist/native/index.d.ts.map +1 -1
- package/dist/native/index.js.map +1 -1
- package/dist/native/sybase_native.darwin-arm64.node +0 -0
- package/dist/native/sybase_native.darwin-x64.node +0 -0
- package/dist/native/sybase_native.linux-arm64.node +0 -0
- package/dist/native/sybase_native.linux-x64.node +0 -0
- package/dist/native/sybase_native.win32-x64.node +0 -0
- package/dist/pool.d.ts +197 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/pool.js +638 -0
- package/dist/pool.js.map +1 -0
- package/dist/query-builders/delete.d.ts +6 -4
- package/dist/query-builders/delete.d.ts.map +1 -1
- package/dist/query-builders/delete.js +4 -4
- package/dist/query-builders/delete.js.map +1 -1
- package/dist/query-builders/index.d.ts +1 -1
- package/dist/query-builders/index.d.ts.map +1 -1
- package/dist/query-builders/index.js.map +1 -1
- package/dist/query-builders/insert.d.ts +28 -4
- package/dist/query-builders/insert.d.ts.map +1 -1
- package/dist/query-builders/insert.js +8 -5
- package/dist/query-builders/insert.js.map +1 -1
- package/dist/query-builders/select-types.d.ts +132 -0
- package/dist/query-builders/select-types.d.ts.map +1 -0
- package/dist/query-builders/select-types.js +2 -0
- package/dist/query-builders/select-types.js.map +1 -0
- package/dist/query-builders/select.d.ts +54 -34
- package/dist/query-builders/select.d.ts.map +1 -1
- package/dist/query-builders/select.js +99 -92
- package/dist/query-builders/select.js.map +1 -1
- package/dist/query-builders/update.d.ts +7 -5
- package/dist/query-builders/update.d.ts.map +1 -1
- package/dist/query-builders/update.js +4 -4
- package/dist/query-builders/update.js.map +1 -1
- package/dist/session.d.ts +141 -14
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +456 -40
- package/dist/session.js.map +1 -1
- package/dist/sql-classify.d.ts +70 -0
- package/dist/sql-classify.d.ts.map +1 -0
- package/dist/sql-classify.js +189 -0
- package/dist/sql-classify.js.map +1 -0
- package/dist/table.d.ts +85 -3
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +8 -2
- package/dist/table.js.map +1 -1
- package/package.json +9 -8
- package/scripts/clean.ts +4 -3
- package/src/native/binding.c +463 -62
package/dist/session.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { emitQueryLog, readServerInt } from "./connection.js";
|
|
1
2
|
import { decodeDateTimeColumns, resolveTimeZone } from "./datetime.js";
|
|
2
|
-
import { SybaseConnectionError } from "./errors.js";
|
|
3
|
+
import { SybaseConnectionError, SybaseError } from "./errors.js";
|
|
4
|
+
import { endsTransaction, mayChangeIdentity, mayCreateTempTable, mayLeaveSessionState } from "./sql-classify.js";
|
|
3
5
|
/** Map isolation level names to Sybase numeric levels. */
|
|
4
6
|
const isolationLevelMap = {
|
|
5
7
|
read_uncommitted: 0,
|
|
@@ -33,6 +35,26 @@ const executeAndDecode = async (run, timeZone) => {
|
|
|
33
35
|
affectedRows: result.affectedRows
|
|
34
36
|
};
|
|
35
37
|
};
|
|
38
|
+
const TRANSACTION_ABORTED = "Transaction was rolled back by the server after an earlier statement failed";
|
|
39
|
+
const TRANSACTION_ENDED = "The transaction was ended by a statement inside it (e.g. a procedure that commits or rolls " +
|
|
40
|
+
"back): work before that statement may already be committed, and nothing more may run in it. " +
|
|
41
|
+
"End a transaction by returning from (or throwing in) the db.transaction() callback.";
|
|
42
|
+
/**
|
|
43
|
+
* COMMIT only the transaction this session opened.
|
|
44
|
+
*
|
|
45
|
+
* ASE rolls a transaction back on its own after some errors (conversion
|
|
46
|
+
* errors, deadlocks, ...), and a raw `commit`/`rollback` inside the callback
|
|
47
|
+
* ends it too. A plain COMMIT TRAN with nothing open succeeds silently, so the
|
|
48
|
+
* caller would be told everything committed. A nested BEGIN left open would
|
|
49
|
+
* likewise survive a single COMMIT and go back to the pool still holding locks.
|
|
50
|
+
*/
|
|
51
|
+
const COMMIT_SQL = `if @@trancount = 1 commit tran
|
|
52
|
+
else begin
|
|
53
|
+
if @@trancount > 0 rollback tran
|
|
54
|
+
raiserror 20000 'drizzle-sybase: transaction ended early or was left nested; not committed'
|
|
55
|
+
end`;
|
|
56
|
+
/** Prefix for the savepoints taken by {@link SybaseTransactionSession.executeAtomic}. */
|
|
57
|
+
const ATOMIC_SAVEPOINT_PREFIX = "drizzle_sybase_sp_";
|
|
36
58
|
export class SybaseSession {
|
|
37
59
|
pool;
|
|
38
60
|
timeZone;
|
|
@@ -52,6 +74,17 @@ export class SybaseSession {
|
|
|
52
74
|
async executeRaw(rawSql, options) {
|
|
53
75
|
return decodeResult(await this.pool.query(rawSql, options), this.timeZone);
|
|
54
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Execute a multi-statement batch all-or-nothing.
|
|
79
|
+
*
|
|
80
|
+
* ASE commits each statement of a batch as it runs and carries on past
|
|
81
|
+
* statement-level errors, so a batch that fails partway would leave the
|
|
82
|
+
* statements before (and possibly after) the failure applied. Running it in
|
|
83
|
+
* a transaction makes it atomic.
|
|
84
|
+
*/
|
|
85
|
+
async executeAtomic(rawSql) {
|
|
86
|
+
return this.transaction(tx => tx.execute(rawSql));
|
|
87
|
+
}
|
|
55
88
|
/**
|
|
56
89
|
* Run a transaction on a single connection.
|
|
57
90
|
*
|
|
@@ -67,46 +100,248 @@ export class SybaseSession {
|
|
|
67
100
|
*/
|
|
68
101
|
async transaction(fn, options) {
|
|
69
102
|
const conn = await this.pool.acquire();
|
|
70
|
-
|
|
103
|
+
let tx;
|
|
71
104
|
try {
|
|
72
|
-
//
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
await conn.query("BEGIN TRAN");
|
|
78
|
-
const tx = new SybaseTransactionSession(conn, this.pool.logger, this.timeZone);
|
|
105
|
+
// The isolation level applies to the transaction begun in the same batch.
|
|
106
|
+
const level = options?.isolationLevel ? isolationLevelMap[options.isolationLevel] : undefined;
|
|
107
|
+
await conn.query(level === undefined ? "BEGIN TRAN" : `SET TRANSACTION ISOLATION LEVEL ${level}\nBEGIN TRAN`);
|
|
108
|
+
tx = new SybaseTransactionSession(conn, this.pool.logger, this.timeZone);
|
|
79
109
|
try {
|
|
80
110
|
const result = await fn(tx);
|
|
81
|
-
|
|
111
|
+
// Ended before COMMIT, not after: once the callback has returned, the
|
|
112
|
+
// connection is about to go back to the pool, and a kept reference to
|
|
113
|
+
// `tx` must not run on it inside someone else's transaction. Anything
|
|
114
|
+
// the callback started without awaiting is refused or finishes first.
|
|
115
|
+
await tx.end();
|
|
116
|
+
// The callback caught a statement error that made the server roll the
|
|
117
|
+
// transaction back. Committing would report success for work that is
|
|
118
|
+
// gone (and for anything run afterwards in autocommit).
|
|
119
|
+
if (tx.abortReason) {
|
|
120
|
+
throw new SybaseError(tx.abortReason);
|
|
121
|
+
}
|
|
122
|
+
await conn.query(COMMIT_SQL);
|
|
82
123
|
return result;
|
|
83
124
|
}
|
|
84
125
|
catch (err) {
|
|
126
|
+
await tx.end();
|
|
85
127
|
// Attempt rollback — ignore errors if connection is dead
|
|
86
128
|
try {
|
|
87
129
|
await conn.query("ROLLBACK TRAN");
|
|
88
130
|
}
|
|
89
|
-
catch
|
|
90
|
-
//
|
|
91
|
-
//
|
|
131
|
+
catch {
|
|
132
|
+
// An alive socket says nothing about @@trancount: the transaction may
|
|
133
|
+
// still be open, so the connection must not be reused. Closing it
|
|
134
|
+
// makes release() discard it.
|
|
135
|
+
conn.close();
|
|
92
136
|
}
|
|
93
137
|
throw err;
|
|
94
138
|
}
|
|
95
139
|
}
|
|
96
140
|
finally {
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
|
|
141
|
+
// The isolation level persists on the connection, and so does anything a
|
|
142
|
+
// raw statement in the callback changed (ROWCOUNT, isolation, ...); none
|
|
143
|
+
// of it may reach the next pool user. A transaction that touched neither
|
|
144
|
+
// pays no extra round-trip: a statement that fails inside it already
|
|
145
|
+
// resets ROWCOUNT (see SybaseTransactionSession).
|
|
146
|
+
if ((options?.isolationLevel || tx?.touchedSessionState) && conn.isConnected) {
|
|
100
147
|
try {
|
|
101
|
-
await conn.
|
|
148
|
+
await conn.resetSessionState();
|
|
102
149
|
}
|
|
103
150
|
catch {
|
|
104
|
-
//
|
|
151
|
+
// State is unknown — discard rather than hand it to the next user.
|
|
152
|
+
conn.close();
|
|
105
153
|
}
|
|
106
154
|
}
|
|
155
|
+
// After the reset and COMMIT/ROLLBACK: dropped inside the transaction, a
|
|
156
|
+
// table would come back on rollback.
|
|
157
|
+
if (tx?.mayHaveCreatedTempTables && conn.isConnected) {
|
|
158
|
+
try {
|
|
159
|
+
await conn.dropTempTables();
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
conn.close();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (tx?.discardConnection) {
|
|
166
|
+
conn.close();
|
|
167
|
+
}
|
|
107
168
|
this.pool.release(conn);
|
|
108
169
|
}
|
|
109
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Run `fn` with one connection to itself, outside any transaction.
|
|
173
|
+
*
|
|
174
|
+
* For work that spans several statements on the same session without being
|
|
175
|
+
* one transaction — typically `#temp` tables, which ASE only lets a
|
|
176
|
+
* transaction create when `ddl in tran` is enabled, and which a pool query
|
|
177
|
+
* drops when it finishes. Each statement autocommits as usual.
|
|
178
|
+
*
|
|
179
|
+
* When `fn` settles the connection goes back to the pool in its baseline
|
|
180
|
+
* state: `#temp` tables are dropped, session options reset, and a
|
|
181
|
+
* transaction left open is rolled back and reported as an error.
|
|
182
|
+
*/
|
|
183
|
+
async withConnection(fn) {
|
|
184
|
+
const conn = await this.pool.acquire();
|
|
185
|
+
const session = new SybaseConnectionSession(conn, this.pool.logger, this.timeZone);
|
|
186
|
+
let result;
|
|
187
|
+
try {
|
|
188
|
+
result = await fn(session);
|
|
189
|
+
}
|
|
190
|
+
catch (err) {
|
|
191
|
+
await session.end();
|
|
192
|
+
await this.releasePinned(conn, session);
|
|
193
|
+
throw err;
|
|
194
|
+
}
|
|
195
|
+
// Finishes anything `fn` started without awaiting, and refuses later use
|
|
196
|
+
// of `session`: the connection may already be someone else's.
|
|
197
|
+
await session.end();
|
|
198
|
+
const leftOpen = await this.releasePinned(conn, session);
|
|
199
|
+
if (leftOpen) {
|
|
200
|
+
throw new SybaseError("withConnection() left a transaction open (or chained mode on); it was rolled back. " +
|
|
201
|
+
"Use db.transaction() for transactions.");
|
|
202
|
+
}
|
|
203
|
+
return result;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Return a {@link withConnection} connection to the pool in its baseline
|
|
207
|
+
* state. Resolves to whether a transaction was left open; a connection whose
|
|
208
|
+
* state cannot be established is discarded.
|
|
209
|
+
*/
|
|
210
|
+
async releasePinned(conn, session) {
|
|
211
|
+
let leftOpen = false;
|
|
212
|
+
try {
|
|
213
|
+
if (conn.isConnected) {
|
|
214
|
+
leftOpen = (await conn.resetSessionState()).leftOpen;
|
|
215
|
+
}
|
|
216
|
+
// After the reset: a drop inside the transaction it rolls back would be undone.
|
|
217
|
+
if (session.mayHaveCreatedTempTables && conn.isConnected) {
|
|
218
|
+
await conn.dropTempTables();
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
conn.close();
|
|
223
|
+
}
|
|
224
|
+
if (session.discardConnection) {
|
|
225
|
+
conn.close();
|
|
226
|
+
}
|
|
227
|
+
this.pool.release(conn);
|
|
228
|
+
return leftOpen;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
// ---------------------------------------------------------------------------
|
|
232
|
+
// Connection session — one held connection, no transaction
|
|
233
|
+
// ---------------------------------------------------------------------------
|
|
234
|
+
/** The session {@link SybaseSession.withConnection} hands its callback. */
|
|
235
|
+
export class SybaseConnectionSession {
|
|
236
|
+
conn;
|
|
237
|
+
logger;
|
|
238
|
+
timeZone;
|
|
239
|
+
ended = false;
|
|
240
|
+
/** Operations run one at a time, as in {@link SybaseTransactionSession}. */
|
|
241
|
+
queue = Promise.resolve();
|
|
242
|
+
_discardConnection = false;
|
|
243
|
+
_mayHaveCreatedTempTables = false;
|
|
244
|
+
constructor(conn, logger, timeZone) {
|
|
245
|
+
this.conn = conn;
|
|
246
|
+
this.logger = logger;
|
|
247
|
+
this.timeZone = timeZone;
|
|
248
|
+
}
|
|
249
|
+
/** @internal Refuse further statements; settles once the current one has finished. */
|
|
250
|
+
async end() {
|
|
251
|
+
this.ended = true;
|
|
252
|
+
await this.queue;
|
|
253
|
+
}
|
|
254
|
+
/** @internal See {@link SybaseTransactionSession.discardConnection}. */
|
|
255
|
+
get discardConnection() {
|
|
256
|
+
return this._discardConnection;
|
|
257
|
+
}
|
|
258
|
+
/** @internal See {@link SybaseTransactionSession.mayHaveCreatedTempTables}. */
|
|
259
|
+
get mayHaveCreatedTempTables() {
|
|
260
|
+
return this._mayHaveCreatedTempTables;
|
|
261
|
+
}
|
|
262
|
+
async execute(rawSql, options) {
|
|
263
|
+
return executeAndDecode(() => this.serialize(() => this.run(rawSql, options)), this.timeZone);
|
|
264
|
+
}
|
|
265
|
+
async executeRaw(rawSql, options) {
|
|
266
|
+
return decodeResult(await this.serialize(() => this.run(rawSql, options)), this.timeZone);
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Execute a multi-statement batch all-or-nothing: in a transaction of its
|
|
270
|
+
* own, or under a savepoint if the caller has opened one with raw SQL.
|
|
271
|
+
*/
|
|
272
|
+
async executeAtomic(rawSql) {
|
|
273
|
+
return executeAndDecode(() => this.serialize(async () => {
|
|
274
|
+
const { rows } = await this.run("select @@trancount as tc", undefined, true);
|
|
275
|
+
const nested = (readServerInt(rows, "tc") ?? 0) > 0;
|
|
276
|
+
const savepoint = `${ATOMIC_SAVEPOINT_PREFIX}1`;
|
|
277
|
+
await this.run(nested ? `save tran ${savepoint}` : "BEGIN TRAN", undefined, true);
|
|
278
|
+
try {
|
|
279
|
+
const result = await this.run(rawSql);
|
|
280
|
+
if (!nested) {
|
|
281
|
+
await this.run(COMMIT_SQL, undefined, true);
|
|
282
|
+
}
|
|
283
|
+
return result;
|
|
284
|
+
}
|
|
285
|
+
catch (err) {
|
|
286
|
+
if (this.conn.isConnected) {
|
|
287
|
+
try {
|
|
288
|
+
await this.conn.query(nested
|
|
289
|
+
? `if @@trancount > 0 rollback tran ${savepoint}`
|
|
290
|
+
: "if @@trancount > 0 rollback tran");
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
// Partial work may remain — abandon the connection.
|
|
294
|
+
this.conn.close();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
throw err;
|
|
298
|
+
}
|
|
299
|
+
}), this.timeZone);
|
|
300
|
+
}
|
|
301
|
+
/** Run `op` after every operation queued before it has settled. */
|
|
302
|
+
serialize(op) {
|
|
303
|
+
const task = this.queue.then(op);
|
|
304
|
+
this.queue = task.catch(() => { });
|
|
305
|
+
return task;
|
|
306
|
+
}
|
|
307
|
+
/** One statement, with logging. Callers must hold the queue. */
|
|
308
|
+
async run(rawSql, options,
|
|
309
|
+
/** Issued by this class itself, so known not to leave state behind. */
|
|
310
|
+
internal = false) {
|
|
311
|
+
if (this.ended) {
|
|
312
|
+
throw new SybaseError("withConnection() has ended; statements must run inside its callback");
|
|
313
|
+
}
|
|
314
|
+
if (!this.conn.isConnected) {
|
|
315
|
+
throw new SybaseConnectionError("Connection is dead");
|
|
316
|
+
}
|
|
317
|
+
if (!internal && mayChangeIdentity(rawSql)) {
|
|
318
|
+
this._discardConnection = true;
|
|
319
|
+
}
|
|
320
|
+
if (!internal && mayCreateTempTable(rawSql)) {
|
|
321
|
+
this._mayHaveCreatedTempTables = true;
|
|
322
|
+
}
|
|
323
|
+
const startTime = Date.now();
|
|
324
|
+
try {
|
|
325
|
+
const result = await this.conn.query(rawSql, options);
|
|
326
|
+
emitQueryLog(this.logger, {
|
|
327
|
+
sql: rawSql,
|
|
328
|
+
durationMs: Date.now() - startTime,
|
|
329
|
+
rowCount: result.rowCount,
|
|
330
|
+
timestamp: new Date(startTime)
|
|
331
|
+
});
|
|
332
|
+
return result;
|
|
333
|
+
}
|
|
334
|
+
catch (err) {
|
|
335
|
+
emitQueryLog(this.logger, {
|
|
336
|
+
sql: rawSql,
|
|
337
|
+
durationMs: Date.now() - startTime,
|
|
338
|
+
rowCount: 0,
|
|
339
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
340
|
+
timestamp: new Date(startTime)
|
|
341
|
+
});
|
|
342
|
+
throw err;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
110
345
|
}
|
|
111
346
|
// ---------------------------------------------------------------------------
|
|
112
347
|
// Transaction session — executes on a single held connection
|
|
@@ -115,52 +350,233 @@ export class SybaseTransactionSession {
|
|
|
115
350
|
conn;
|
|
116
351
|
logger;
|
|
117
352
|
timeZone;
|
|
353
|
+
ended = false;
|
|
354
|
+
/** Why the transaction can no longer be used, once it cannot. */
|
|
355
|
+
_abortReason;
|
|
356
|
+
/**
|
|
357
|
+
* Tail of the operations run on this transaction, one at a time.
|
|
358
|
+
*
|
|
359
|
+
* The connection already serializes single queries, but an operation here is
|
|
360
|
+
* several: the statement, then the reset that finds out whether the server
|
|
361
|
+
* rolled the transaction back (and, for {@link executeAtomic}, a savepoint
|
|
362
|
+
* around both). Interleaved with another operation's queries, a statement
|
|
363
|
+
* queued behind a failure would run after the rollback — in autocommit — and
|
|
364
|
+
* a savepoint rollback could undo another caller's work.
|
|
365
|
+
*/
|
|
366
|
+
queue = Promise.resolve();
|
|
367
|
+
savepoints = 0;
|
|
368
|
+
_touchedSessionState = false;
|
|
369
|
+
_discardConnection = false;
|
|
370
|
+
_mayHaveCreatedTempTables = false;
|
|
118
371
|
constructor(conn, logger, timeZone) {
|
|
119
372
|
this.conn = conn;
|
|
120
373
|
this.logger = logger;
|
|
121
374
|
this.timeZone = resolveTimeZone(timeZone);
|
|
122
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* @internal Called by {@link SybaseSession.transaction} when the callback
|
|
378
|
+
* settles. Operations already queued are refused; the returned promise
|
|
379
|
+
* settles once the one in progress (if any) has finished, so nothing runs on
|
|
380
|
+
* the connection after COMMIT/ROLLBACK.
|
|
381
|
+
*/
|
|
382
|
+
async end() {
|
|
383
|
+
this.ended = true;
|
|
384
|
+
await this.queue;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Whether the transaction has ended underneath the callback — rolled back by
|
|
388
|
+
* the server after a failed statement, or ended by a statement in it.
|
|
389
|
+
* Further statements are refused: they would run in autocommit mode.
|
|
390
|
+
*/
|
|
391
|
+
get aborted() {
|
|
392
|
+
return this._abortReason !== undefined;
|
|
393
|
+
}
|
|
394
|
+
/** @internal Why {@link aborted} is set. */
|
|
395
|
+
get abortReason() {
|
|
396
|
+
return this._abortReason;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* @internal Whether a statement may have changed session state that outlives
|
|
400
|
+
* the transaction (see `mayLeaveSessionState`), so the connection needs a
|
|
401
|
+
* reset before it goes back to the pool.
|
|
402
|
+
*/
|
|
403
|
+
get touchedSessionState() {
|
|
404
|
+
return this._touchedSessionState;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @internal A statement may have switched the session's identity
|
|
408
|
+
* (`setuser`), which cannot be restored, so the connection must be discarded
|
|
409
|
+
* when the transaction ends.
|
|
410
|
+
*/
|
|
411
|
+
get discardConnection() {
|
|
412
|
+
return this._discardConnection;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* @internal A statement may have created a `#temp` table, which must not
|
|
416
|
+
* outlive the transaction on a pooled connection.
|
|
417
|
+
*/
|
|
418
|
+
get mayHaveCreatedTempTables() {
|
|
419
|
+
return this._mayHaveCreatedTempTables;
|
|
420
|
+
}
|
|
123
421
|
/**
|
|
124
422
|
* Execute raw SQL within the transaction.
|
|
125
423
|
*/
|
|
126
424
|
async execute(rawSql, options) {
|
|
127
|
-
return executeAndDecode(() => this.
|
|
425
|
+
return executeAndDecode(() => this.serialize(() => this.run(rawSql, options)), this.timeZone);
|
|
128
426
|
}
|
|
129
427
|
async executeRaw(rawSql, options) {
|
|
130
|
-
return decodeResult(await this.
|
|
428
|
+
return decodeResult(await this.serialize(() => this.run(rawSql, options)), this.timeZone);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Execute a multi-statement batch all-or-nothing, without ending the
|
|
432
|
+
* enclosing transaction.
|
|
433
|
+
*
|
|
434
|
+
* ASE carries on with the rest of a batch after a statement-level error such
|
|
435
|
+
* as a duplicate key, so a caller that catches the error would otherwise
|
|
436
|
+
* commit the statements around the failed one. A savepoint taken first (in
|
|
437
|
+
* its own round-trip: a batch that fails to compile never runs it) lets just
|
|
438
|
+
* this batch be undone. Each call gets its own savepoint name.
|
|
439
|
+
*/
|
|
440
|
+
async executeAtomic(rawSql) {
|
|
441
|
+
return executeAndDecode(() => this.serialize(async () => {
|
|
442
|
+
const savepoint = `${ATOMIC_SAVEPOINT_PREFIX}${++this.savepoints}`;
|
|
443
|
+
await this.run(`save tran ${savepoint}`, undefined, true);
|
|
444
|
+
try {
|
|
445
|
+
return await this.run(rawSql);
|
|
446
|
+
}
|
|
447
|
+
catch (err) {
|
|
448
|
+
if (!this.aborted && this.conn.isConnected) {
|
|
449
|
+
try {
|
|
450
|
+
await this.conn.query(`rollback tran ${savepoint}`);
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
// Partial work may remain in the transaction — abandon it.
|
|
454
|
+
this.conn.close();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
throw err;
|
|
458
|
+
}
|
|
459
|
+
}), this.timeZone);
|
|
131
460
|
}
|
|
132
461
|
// ---------------------------------------------------------------------------
|
|
133
462
|
// Private
|
|
134
463
|
// ---------------------------------------------------------------------------
|
|
135
|
-
|
|
464
|
+
/** Run `op` after every operation queued before it has settled. */
|
|
465
|
+
serialize(op) {
|
|
466
|
+
const task = this.queue.then(op);
|
|
467
|
+
this.queue = task.catch(() => { });
|
|
468
|
+
return task;
|
|
469
|
+
}
|
|
470
|
+
/** One statement, with logging and failure cleanup. Callers must hold the queue. */
|
|
471
|
+
async run(rawSql, options,
|
|
472
|
+
/** Issued by this class itself, so known not to leave state behind. */
|
|
473
|
+
internal = false) {
|
|
474
|
+
if (this.ended) {
|
|
475
|
+
throw new SybaseError("Transaction has already ended; statements must run inside the transaction callback");
|
|
476
|
+
}
|
|
477
|
+
if (this._abortReason) {
|
|
478
|
+
throw new SybaseError(this._abortReason);
|
|
479
|
+
}
|
|
480
|
+
// Refused before it is sent: once a COMMIT/ROLLBACK runs, the rest of its
|
|
481
|
+
// batch would run in autocommit, beyond anything a later check can undo.
|
|
482
|
+
if (!internal && endsTransaction(rawSql)) {
|
|
483
|
+
throw new SybaseError("COMMIT and ROLLBACK cannot run inside db.transaction(): the transaction ends when the " +
|
|
484
|
+
"callback returns (commit) or throws (rollback). Savepoints (`save tran x` / " +
|
|
485
|
+
"`rollback tran x`) are allowed.");
|
|
486
|
+
}
|
|
136
487
|
if (!this.conn.isConnected) {
|
|
137
488
|
throw new SybaseConnectionError("Transaction connection is dead");
|
|
138
489
|
}
|
|
139
490
|
const startTime = Date.now();
|
|
491
|
+
const checkState = !internal && mayLeaveSessionState(rawSql);
|
|
492
|
+
if (checkState) {
|
|
493
|
+
this._touchedSessionState = true;
|
|
494
|
+
}
|
|
495
|
+
if (!internal && mayChangeIdentity(rawSql)) {
|
|
496
|
+
this._discardConnection = true;
|
|
497
|
+
}
|
|
498
|
+
if (!internal && mayCreateTempTable(rawSql)) {
|
|
499
|
+
this._mayHaveCreatedTempTables = true;
|
|
500
|
+
}
|
|
501
|
+
let result;
|
|
140
502
|
try {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
return result;
|
|
503
|
+
result = await this.conn.query(rawSql, options);
|
|
504
|
+
emitQueryLog(this.logger, {
|
|
505
|
+
sql: rawSql,
|
|
506
|
+
durationMs: Date.now() - startTime,
|
|
507
|
+
rowCount: result.rowCount,
|
|
508
|
+
timestamp: new Date(startTime)
|
|
509
|
+
});
|
|
151
510
|
}
|
|
152
511
|
catch (err) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
512
|
+
emitQueryLog(this.logger, {
|
|
513
|
+
sql: rawSql,
|
|
514
|
+
durationMs: Date.now() - startTime,
|
|
515
|
+
rowCount: 0,
|
|
516
|
+
error: err instanceof Error ? err : new Error(String(err)),
|
|
517
|
+
timestamp: new Date(startTime)
|
|
518
|
+
});
|
|
519
|
+
await this.afterFailure();
|
|
162
520
|
throw err;
|
|
163
521
|
}
|
|
522
|
+
// A statement that can end a transaction — a raw COMMIT / ROLLBACK, or a
|
|
523
|
+
// procedure that runs one — succeeds without telling us. Everything after
|
|
524
|
+
// it would run in autocommit, outside the transaction the caller thinks it
|
|
525
|
+
// is in, and nothing at commit time could undo that. So confirm the
|
|
526
|
+
// transaction is still open before the next statement may run.
|
|
527
|
+
if (checkState) {
|
|
528
|
+
await this.confirmStillOpen();
|
|
529
|
+
}
|
|
530
|
+
return result;
|
|
531
|
+
}
|
|
532
|
+
/** See {@link run}: refuse to continue once the transaction has ended. */
|
|
533
|
+
async confirmStillOpen() {
|
|
534
|
+
let trancount;
|
|
535
|
+
try {
|
|
536
|
+
const { rows } = await this.conn.query("select @@trancount as tc");
|
|
537
|
+
trancount = readServerInt(rows, "tc");
|
|
538
|
+
}
|
|
539
|
+
catch {
|
|
540
|
+
// Handled below as unknown.
|
|
541
|
+
}
|
|
542
|
+
if (trancount === undefined) {
|
|
543
|
+
this.conn.close();
|
|
544
|
+
throw new SybaseError("Could not confirm the transaction is still open after the statement; the connection " +
|
|
545
|
+
"was discarded, rolling back the transaction");
|
|
546
|
+
}
|
|
547
|
+
if (trancount === 0) {
|
|
548
|
+
this._abortReason = TRANSACTION_ENDED;
|
|
549
|
+
throw new SybaseError(TRANSACTION_ENDED);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Restore a usable, known session state after a failed statement.
|
|
554
|
+
*
|
|
555
|
+
* A failed raw batch can skip its trailing `SET ROWCOUNT 0`, and the
|
|
556
|
+
* caller may catch the error and keep using the transaction — every later
|
|
557
|
+
* statement would then be silently truncated. The same round-trip reads
|
|
558
|
+
* `@@trancount` to learn whether the server rolled the transaction back. If
|
|
559
|
+
* either cannot be established the state is unknown, so the connection is
|
|
560
|
+
* closed (aborting the transaction) rather than used further.
|
|
561
|
+
*/
|
|
562
|
+
async afterFailure() {
|
|
563
|
+
if (!this.conn.isConnected) {
|
|
564
|
+
return;
|
|
565
|
+
}
|
|
566
|
+
let trancount;
|
|
567
|
+
try {
|
|
568
|
+
const { rows } = await this.conn.query("SET ROWCOUNT 0\nselect @@trancount as tc");
|
|
569
|
+
trancount = readServerInt(rows, "tc");
|
|
570
|
+
}
|
|
571
|
+
catch {
|
|
572
|
+
// Handled below as unknown.
|
|
573
|
+
}
|
|
574
|
+
if (trancount === undefined) {
|
|
575
|
+
this.conn.close();
|
|
576
|
+
}
|
|
577
|
+
else if (trancount === 0) {
|
|
578
|
+
this._abortReason = TRANSACTION_ABORTED;
|
|
579
|
+
}
|
|
164
580
|
}
|
|
165
581
|
}
|
|
166
582
|
//# sourceMappingURL=session.js.map
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAoBpD,0DAA0D;AAC1D,MAAM,iBAAiB,GAAyC;IAC9D,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;CAChB,CAAC;AAwBF;;;;;;;GAOG;AACH,MAAM,YAAY,GAAG,CACnB,MAAsB,EACtB,QAAgB,EACA,EAAE,CAAC,CAAC;IACpB,GAAG,MAAM;IACT,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,I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