@proteinjs/db-driver-knex 1.3.0 → 1.4.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,17 @@
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.4.0](https://github.com/proteinjs/db/compare/@proteinjs/db-driver-knex@1.3.0...@proteinjs/db-driver-knex@1.4.0) (2025-02-07)
7
+
8
+
9
+ ### Features
10
+
11
+ * Dynamic reference column ([#12](https://github.com/proteinjs/db/issues/12)) ([554b2e4](https://github.com/proteinjs/db/commit/554b2e4159f1d692d2ae976461c60f88639ecf22))
12
+
13
+
14
+
15
+
16
+
6
17
  # [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
18
 
8
19
 
@@ -62,6 +62,14 @@ var knexDriverColumnTypesTests = new KnexDriver_1.KnexDriver({
62
62
  describe('Column Type Tests', (0, db_1.columnTypeTests)(knexDriverColumnTypesTests, new db_transaction_context_1.TransactionContext(), function (table) {
63
63
  return dropTable(knexDriverColumnTypesTests, table);
64
64
  }));
65
+ var knexDriverDynamicRefCol = new KnexDriver_1.KnexDriver({
66
+ host: 'localhost',
67
+ user: 'root',
68
+ password: '',
69
+ dbName: 'test',
70
+ }, db_1.getDynamicReferenceColumnTestTable);
71
+ describe('DynamicReferenceColumn Tests', (0, db_1.dynamicReferenceColumnTests)(knexDriverDynamicRefCol, function (table) { return dropTable(knexDriverDynamicRefCol, table); }));
72
+ // driver will be stopped in this test, any tests put after this one will not establish connection
65
73
  var knexDriverCrudTests = new KnexDriver_1.KnexDriver({
66
74
  host: 'localhost',
67
75
  user: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"Crud.test.js","sourceRoot":"","sources":["../../test/Crud.test.ts"],"names":[],"mappings":";;;;;;;;;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,KAAK,CAAC,EAAzC,CAAyC,CAAC,CAC3G,CAAC;AAEF,kGAAkG;AAClG,IAAM,mBAAmB,GAAG,IAAI,uBAAU,CACxC;IACE,IAAI,EAAE,WAAW;IACjB,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/db-driver-knex",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Db driver for Knex",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -22,9 +22,9 @@
22
22
  "test": "jest"
23
23
  },
24
24
  "dependencies": {
25
- "@proteinjs/db": "^1.11.0",
25
+ "@proteinjs/db": "^1.12.0",
26
26
  "@proteinjs/db-query": "^1.2.9",
27
- "@proteinjs/db-transaction-context": "^0.1.1",
27
+ "@proteinjs/db-transaction-context": "^0.2.0",
28
28
  "@proteinjs/logger": "1.0.6",
29
29
  "@proteinjs/reflection": "1.1.9",
30
30
  "@proteinjs/util": "1.4.1",
@@ -50,5 +50,5 @@
50
50
  },
51
51
  "main": "./dist/generated/index.js",
52
52
  "types": "./dist/generated/index.d.ts",
53
- "gitHead": "af68c385df1ef06e2b7b478fce866d3e9cfe8bb7"
53
+ "gitHead": "f3c64e4da2badc2aa155b38aa79ddda1a10878ec"
54
54
  }
package/test/Crud.test.ts CHANGED
@@ -1,4 +1,12 @@
1
- import { Table, columnTypeTests, crudTests, getColTypeTestTable, getCrudTestTable } from '@proteinjs/db';
1
+ import {
2
+ Table,
3
+ columnTypeTests,
4
+ crudTests,
5
+ getColTypeTestTable,
6
+ getCrudTestTable,
7
+ getDynamicReferenceColumnTestTable,
8
+ dynamicReferenceColumnTests,
9
+ } from '@proteinjs/db';
2
10
  import { KnexDriver } from '../src/KnexDriver';
3
11
  import { TransactionContext } from '@proteinjs/db-transaction-context';
4
12
 
@@ -25,6 +33,22 @@ describe(
25
33
  )
26
34
  );
27
35
 
36
+ const knexDriverDynamicRefCol = new KnexDriver(
37
+ {
38
+ host: 'localhost',
39
+ user: 'root',
40
+ password: '',
41
+ dbName: 'test',
42
+ },
43
+ getDynamicReferenceColumnTestTable
44
+ );
45
+
46
+ describe(
47
+ 'DynamicReferenceColumn Tests',
48
+ dynamicReferenceColumnTests(knexDriverDynamicRefCol, (table) => dropTable(knexDriverDynamicRefCol, table))
49
+ );
50
+
51
+ // driver will be stopped in this test, any tests put after this one will not establish connection
28
52
  const knexDriverCrudTests = new KnexDriver(
29
53
  {
30
54
  host: 'localhost',