velocious 1.0.57 → 1.0.58

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "velocious": "bin/velocious.js"
4
4
  },
5
5
  "name": "velocious",
6
- "version": "1.0.57",
6
+ "version": "1.0.58",
7
7
  "main": "index.js",
8
8
  "scripts": {
9
9
  "test": "VELOCIOUS_TEST_DIR=../ cd spec/dummy && npx velocious test",
@@ -22,7 +22,6 @@
22
22
  "homepage": "https://github.com/kaspernj/velocious#readme",
23
23
  "description": "",
24
24
  "dependencies": {
25
- "async-mutex": "^0.5.0",
26
25
  "awaitery": "^1.0.1",
27
26
  "bcryptjs": "^3.0.2",
28
27
  "better-localstorage": "^1.0.7",
@@ -30,6 +29,7 @@
30
29
  "diggerize": "^1.0.5",
31
30
  "ejs": "^3.1.6",
32
31
  "env-sense": "^1.0.0",
32
+ "epic-locks": "^1.0.3",
33
33
  "escape-string-regexp": "^1.0.5",
34
34
  "incorporator": "^1.0.2",
35
35
  "inflection": "^3.0.0",
@@ -1,12 +1,12 @@
1
1
  import {Logger} from "../../logger.js"
2
2
  import Query from "../query/index.js"
3
3
  import Handler from "../handler.js"
4
+ import Mutex from "epic-locks/src/mutex.js"
4
5
  import strftime from "strftime"
5
6
  import UUID from "pure-uuid"
6
7
  import TableData from "../table-data/index.js"
7
8
  import TableColumn from "../table-data/table-column.js"
8
9
  import TableForeignKey from "../table-data/table-foreign-key.js"
9
- import {Mutex} from "async-mutex"
10
10
 
11
11
  export default class VelociousDatabaseDriversBase {
12
12
  constructor(config, configuration) {
@@ -209,7 +209,7 @@ export default class VelociousDatabaseDriversBase {
209
209
  }
210
210
 
211
211
  async startTransaction() {
212
- await this._transactionsActionsMutex.runExclusive(async () => {
212
+ await this._transactionsActionsMutex.sync(async () => {
213
213
  await this._startTransactionAction()
214
214
  this._transactionsCount++
215
215
  })
@@ -220,7 +220,7 @@ export default class VelociousDatabaseDriversBase {
220
220
  }
221
221
 
222
222
  async commitTransaction() {
223
- await this._transactionsActionsMutex.runExclusive(async () => {
223
+ await this._transactionsActionsMutex.sync(async () => {
224
224
  await this._commitTransactionAction()
225
225
  this._transactionsCount--
226
226
  })
@@ -231,7 +231,7 @@ export default class VelociousDatabaseDriversBase {
231
231
  }
232
232
 
233
233
  async rollbackTransaction() {
234
- await this._transactionsActionsMutex.runExclusive(async () => {
234
+ await this._transactionsActionsMutex.sync(async () => {
235
235
  await this._rollbackTransactionAction()
236
236
  this._transactionsCount--
237
237
  })
@@ -246,7 +246,7 @@ export default class VelociousDatabaseDriversBase {
246
246
  }
247
247
 
248
248
  async startSavePoint(savePointName) {
249
- await this._transactionsActionsMutex.runExclusive(async () => {
249
+ await this._transactionsActionsMutex.sync(async () => {
250
250
  await this._startSavePointAction(savePointName)
251
251
  })
252
252
  }
@@ -272,7 +272,7 @@ export default class VelociousDatabaseDriversBase {
272
272
  }
273
273
 
274
274
  async releaseSavePoint(savePointName) {
275
- await this._transactionsActionsMutex.runExclusive(async () => {
275
+ await this._transactionsActionsMutex.sync(async () => {
276
276
  await this._releaseSavePointAction(savePointName)
277
277
  })
278
278
  }
@@ -282,7 +282,7 @@ export default class VelociousDatabaseDriversBase {
282
282
  }
283
283
 
284
284
  async rollbackSavePoint(savePointName) {
285
- await this._transactionsActionsMutex.runExclusive(async () => {
285
+ await this._transactionsActionsMutex.sync(async () => {
286
286
  await this._rollbackSavePointAction(savePointName)
287
287
  })
288
288
  }