@sqb/connect 4.19.0 → 4.19.2

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Column = Column;
4
+ const builder_1 = require("@sqb/builder");
4
5
  const entity_metadata_js_1 = require("../model/entity-metadata.js");
5
6
  const orm_const_js_1 = require("../orm.const.js");
6
7
  function Column(arg0) {
@@ -21,6 +22,9 @@ Column[orm_const_js_1.DECORATOR_FACTORY] = function (arg0) {
21
22
  else
22
23
  options.type = typ;
23
24
  }
25
+ if (!options.dataType && typeof options.type === 'function' && entity_metadata_js_1.EntityMetadata.get(options.type)) {
26
+ options.dataType = builder_1.DataType.JSON;
27
+ }
24
28
  entity_metadata_js_1.EntityMetadata.defineColumnField(entity, propertyKey, options);
25
29
  };
26
30
  };
@@ -1,3 +1,4 @@
1
+ import { DataType } from '@sqb/builder';
1
2
  import { EntityMetadata } from '../model/entity-metadata.js';
2
3
  import { DECORATOR_FACTORY } from '../orm.const.js';
3
4
  export function Column(arg0) {
@@ -18,6 +19,9 @@ Column[DECORATOR_FACTORY] = function (arg0) {
18
19
  else
19
20
  options.type = typ;
20
21
  }
22
+ if (!options.dataType && typeof options.type === 'function' && EntityMetadata.get(options.type)) {
23
+ options.dataType = DataType.JSON;
24
+ }
21
25
  EntityMetadata.defineColumnField(entity, propertyKey, options);
22
26
  };
23
27
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sqb/connect",
3
3
  "description": "Multi-dialect database connection framework written with TypeScript",
4
- "version": "4.19.0",
4
+ "version": "4.19.2",
5
5
  "author": "Panates",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
@@ -20,7 +20,7 @@
20
20
  "tslib": "^2.7.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@sqb/builder": "^4.19.0",
23
+ "@sqb/builder": "^4.19.2",
24
24
  "reflect-metadata": "^0.2.2"
25
25
  },
26
26
  "type": "module",