@proteinjs/db-driver-knex 1.2.3 → 1.3.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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.3.0](https://github.com/proteinjs/db/compare/@proteinjs/db-driver-knex@1.2.3...@proteinjs/db-driver-knex@1.3.0) (2024-12-11)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add transactionContextFactory to tests to bypass reflection error ([d8021f4](https://github.com/proteinjs/db/commit/d8021f4b5ed19f9bc536af8e62703d7ff51f635a))
12
+
13
+
14
+ ### Features
15
+
16
+ * implement usage of new transaction context package in db and add it as dependency in db driver packages ([a1bc03a](https://github.com/proteinjs/db/commit/a1bc03ae7cde59237ab24a7cbb3e168b4425df9d))
17
+
18
+
19
+
20
+
21
+
6
22
  ## [1.2.3](https://github.com/proteinjs/db/compare/@proteinjs/db-driver-knex@1.2.2...@proteinjs/db-driver-knex@1.2.3) (2024-12-10)
7
23
 
8
24
 
@@ -1,6 +1,7 @@
1
1
  /** Load Dependency Source Graphs */
2
2
  import '@proteinjs/db';
3
3
  import '@proteinjs/db-query';
4
+ import '@proteinjs/db-transaction-context';
4
5
  import '@proteinjs/logger';
5
6
  import '@proteinjs/reflection';
6
7
  import '@proteinjs/util';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,CAAC;AAChB,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC;AAyBd,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,OAAO,eAAe,CAAC;AACvB,OAAO,qBAAqB,CAAC;AAC7B,OAAO,mCAAmC,CAAC;AAC3C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,iBAAiB,CAAC;AACzB,OAAO,MAAM,CAAC;AACd,OAAO,QAAQ,CAAC;AAChB,OAAO,OAAO,CAAC;AACf,OAAO,MAAM,CAAC;AAyBd,cAAc,UAAU,CAAC"}
@@ -17,6 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  require("@proteinjs/db");
19
19
  require("@proteinjs/db-query");
20
+ require("@proteinjs/db-transaction-context");
20
21
  require("@proteinjs/logger");
21
22
  require("@proteinjs/reflection");
22
23
  require("@proteinjs/util");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,+BAA6B;AAC7B,6BAA2B;AAC3B,iCAA+B;AAC/B,2BAAyB;AACzB,gBAAc;AACd,kBAAgB;AAChB,iBAAe;AACf,gBAAc;AAGd,4BAA4B;AAE5B,IAAM,WAAW,GAAG,02UAA02U,CAAC;AAG/3U,4BAA4B;AAE5B,gDAA+C;AAC/C,oEAAmE;AAEnE,IAAM,WAAW,GAAG;IACnB,sCAAsC,EAAE,uBAAU;IAClD,gDAAgD,EAAE,2CAAoB;CACtE,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,+BAA6B;AAC7B,6CAA2C;AAC3C,6BAA2B;AAC3B,iCAA+B;AAC/B,2BAAyB;AACzB,gBAAc;AACd,kBAAgB;AAChB,iBAAe;AACf,gBAAc;AAGd,4BAA4B;AAE5B,IAAM,WAAW,GAAG,02UAA02U,CAAC;AAG/3U,4BAA4B;AAE5B,gDAA+C;AAC/C,oEAAmE;AAEnE,IAAM,WAAW,GAAG;IACnB,sCAAsC,EAAE,uBAAU;IAClD,gDAAgD,EAAE,2CAAoB;CACtE,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
@@ -38,6 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var db_1 = require("@proteinjs/db");
40
40
  var KnexDriver_1 = require("../src/KnexDriver");
41
+ var db_transaction_context_1 = require("@proteinjs/db-transaction-context");
41
42
  var dropTable = function (knexDriver, table) { return __awaiter(void 0, void 0, void 0, function () {
42
43
  return __generator(this, function (_a) {
43
44
  switch (_a.label) {
@@ -58,12 +59,14 @@ var knexDriverColumnTypesTests = new KnexDriver_1.KnexDriver({
58
59
  password: '',
59
60
  dbName: 'test',
60
61
  }, db_1.getColTypeTestTable);
61
- describe('Column Type Tests', (0, db_1.columnTypeTests)(knexDriverColumnTypesTests, function (table) { return dropTable(knexDriverColumnTypesTests, table); }));
62
+ describe('Column Type Tests', (0, db_1.columnTypeTests)(knexDriverColumnTypesTests, new db_transaction_context_1.TransactionContext(), function (table) {
63
+ return dropTable(knexDriverColumnTypesTests, table);
64
+ }));
62
65
  var knexDriverCrudTests = new KnexDriver_1.KnexDriver({
63
66
  host: 'localhost',
64
67
  user: 'root',
65
68
  password: '',
66
69
  dbName: 'test',
67
70
  }, db_1.getCrudTestTable);
68
- describe('CRUD Tests', (0, db_1.crudTests)(knexDriverCrudTests, function (table) { return dropTable(knexDriverCrudTests, table); }));
71
+ describe('CRUD Tests', (0, db_1.crudTests)(knexDriverCrudTests, new db_transaction_context_1.TransactionContext(), function (table) { return dropTable(knexDriverCrudTests, table); }));
69
72
  //# sourceMappingURL=Crud.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Crud.test.js","sourceRoot":"","sources":["../../test/Crud.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAyG;AACzG,gDAA+C;AAE/C,IAAM,SAAS,GAAG,UAAO,UAAsB,EAAE,KAAiB;;;oBAC5D,qBAAM,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAA;;qBAAzF,SAAyF,EAAzF,wBAAyF;gBAC3F,qBAAM,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAA;;gBAA1F,SAA0F,CAAC;;;;;KAE9F,CAAC;AAEF,IAAM,0BAA0B,GAAG,IAAI,uBAAU,CAC/C;IACE,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM;CACf,EACD,wBAAmB,CACpB,CAAC;AAEF,QAAQ,CACN,mBAAmB,EACnB,IAAA,oBAAe,EAAC,0BAA0B,EAAE,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,0BAA0B,EAAE,KAAK,CAAC,EAA5C,CAA4C,CAAC,CACrG,CAAC;AAEF,IAAM,mBAAmB,GAAG,IAAI,uBAAU,CACxC;IACE,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,EAAE;IAC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,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM;CACf,EACD,qBAAgB,CACjB,CAAC;AAEF,QAAQ,CACN,YAAY,EACZ,IAAA,cAAS,EAAC,mBAAmB,EAAE,IAAI,2CAAkB,EAAE,EAAE,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAArC,CAAqC,CAAC,CAC3G,CAAC"}
@@ -38,6 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  var db_1 = require("@proteinjs/db");
40
40
  var KnexDriver_1 = require("../src/KnexDriver");
41
+ var db_transaction_context_1 = require("@proteinjs/db-transaction-context");
41
42
  var dropTable = function (knexDriver, table) { return __awaiter(void 0, void 0, void 0, function () {
42
43
  return __generator(this, function (_a) {
43
44
  switch (_a.label) {
@@ -58,5 +59,5 @@ var knexDriver = new KnexDriver_1.KnexDriver({
58
59
  password: '',
59
60
  dbName: 'test',
60
61
  }, db_1.getTransactionTestTable);
61
- describe('Transaction Tests', (0, db_1.transactionTests)(knexDriver, function (table) { return dropTable(knexDriver, table); }));
62
+ describe('Transaction Tests', (0, db_1.transactionTests)(knexDriver, new db_transaction_context_1.TransactionContext(), function (table) { return dropTable(knexDriver, table); }));
62
63
  //# sourceMappingURL=Transaction.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Transaction.test.js","sourceRoot":"","sources":["../../test/Transaction.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAiF;AACjF,gDAA+C;AAE/C,IAAM,SAAS,GAAG,UAAO,UAAsB,EAAE,KAAiB;;;oBAC5D,qBAAM,UAAU,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAA;;q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Z,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM;CACf,EACD,4BAAuB,CACxB,CAAC;AAEF,QAAQ,CACN,mBAAmB,EACnB,IAAA,qBAAgB,EAAC,UAAU,EAAE,IAAI,2CAAkB,EAAE,EAAE,UAAC,KAAK,IAAK,OAAA,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,EAA5B,CAA4B,CAAC,CAChG,CAAC"}
@@ -2,6 +2,7 @@
2
2
 
3
3
  import '@proteinjs/db';
4
4
  import '@proteinjs/db-query';
5
+ import '@proteinjs/db-transaction-context';
5
6
  import '@proteinjs/logger';
6
7
  import '@proteinjs/reflection';
7
8
  import '@proteinjs/util';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/db-driver-knex",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "Db driver for Knex",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,8 +22,9 @@
22
22
  "test": "jest"
23
23
  },
24
24
  "dependencies": {
25
- "@proteinjs/db": "^1.10.0",
25
+ "@proteinjs/db": "^1.11.0",
26
26
  "@proteinjs/db-query": "^1.2.9",
27
+ "@proteinjs/db-transaction-context": "^0.1.1",
27
28
  "@proteinjs/logger": "1.0.6",
28
29
  "@proteinjs/reflection": "1.1.9",
29
30
  "@proteinjs/util": "1.4.1",
@@ -49,5 +50,5 @@
49
50
  },
50
51
  "main": "./dist/generated/index.js",
51
52
  "types": "./dist/generated/index.d.ts",
52
- "gitHead": "9fa91dc6491e0d2ae5252c27aa2997b58d071400"
53
+ "gitHead": "af68c385df1ef06e2b7b478fce866d3e9cfe8bb7"
53
54
  }
package/test/Crud.test.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Table, columnTypeTests, crudTests, getColTypeTestTable, getCrudTestTable } from '@proteinjs/db';
2
2
  import { KnexDriver } from '../src/KnexDriver';
3
+ import { TransactionContext } from '@proteinjs/db-transaction-context';
3
4
 
4
5
  const dropTable = async (knexDriver: KnexDriver, table: Table<any>) => {
5
6
  if (await knexDriver.getKnex().schema.withSchema(knexDriver.getDbName()).hasTable(table.name)) {
@@ -19,7 +20,9 @@ const knexDriverColumnTypesTests = new KnexDriver(
19
20
 
20
21
  describe(
21
22
  'Column Type Tests',
22
- columnTypeTests(knexDriverColumnTypesTests, (table) => dropTable(knexDriverColumnTypesTests, table))
23
+ columnTypeTests(knexDriverColumnTypesTests, new TransactionContext(), (table) =>
24
+ dropTable(knexDriverColumnTypesTests, table)
25
+ )
23
26
  );
24
27
 
25
28
  const knexDriverCrudTests = new KnexDriver(
@@ -34,5 +37,5 @@ const knexDriverCrudTests = new KnexDriver(
34
37
 
35
38
  describe(
36
39
  'CRUD Tests',
37
- crudTests(knexDriverCrudTests, (table) => dropTable(knexDriverCrudTests, table))
40
+ crudTests(knexDriverCrudTests, new TransactionContext(), (table) => dropTable(knexDriverCrudTests, table))
38
41
  );
@@ -1,5 +1,6 @@
1
1
  import { transactionTests, getTransactionTestTable, Table } from '@proteinjs/db';
2
2
  import { KnexDriver } from '../src/KnexDriver';
3
+ import { TransactionContext } from '@proteinjs/db-transaction-context';
3
4
 
4
5
  const dropTable = async (knexDriver: KnexDriver, table: Table<any>) => {
5
6
  if (await knexDriver.getKnex().schema.withSchema(knexDriver.getDbName()).hasTable(table.name)) {
@@ -19,5 +20,5 @@ const knexDriver = new KnexDriver(
19
20
 
20
21
  describe(
21
22
  'Transaction Tests',
22
- transactionTests(knexDriver, (table) => dropTable(knexDriver, table))
23
+ transactionTests(knexDriver, new TransactionContext(), (table) => dropTable(knexDriver, table))
23
24
  );