@sqb/connect 5.0.0 → 5.0.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,4 +1,4 @@
|
|
|
1
|
-
import { And, Param, TableName, Update } from '@sqb/builder';
|
|
1
|
+
import { And, Param, SqlElement, TableName, Update } from '@sqb/builder';
|
|
2
2
|
import { checkEnumValue, isColumnField, isEmbeddedField, resolveEntityForEmbeddedField, } from '../util/orm.helper.js';
|
|
3
3
|
import { prepareFilter } from './command.helper.js';
|
|
4
4
|
export class UpdateCommand {
|
|
@@ -61,6 +61,11 @@ export class UpdateCommand {
|
|
|
61
61
|
if (isColumnField(col)) {
|
|
62
62
|
if (col.noUpdate)
|
|
63
63
|
continue;
|
|
64
|
+
const fieldName = prefix + col.fieldName + suffix;
|
|
65
|
+
if (v instanceof SqlElement) {
|
|
66
|
+
ctx.queryValues[fieldName] = v;
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
64
69
|
if (typeof col.serialize === 'function')
|
|
65
70
|
v = col.serialize(v, col.name);
|
|
66
71
|
if (v === null && col.notNull)
|
|
@@ -68,7 +73,6 @@ export class UpdateCommand {
|
|
|
68
73
|
if (v === undefined)
|
|
69
74
|
continue;
|
|
70
75
|
checkEnumValue(col, v);
|
|
71
|
-
const fieldName = prefix + col.fieldName + suffix;
|
|
72
76
|
const k = ('I$_' + fieldName).substring(0, 30);
|
|
73
77
|
ctx.queryValues[fieldName] = Param({
|
|
74
78
|
name: k,
|
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": "5.0.
|
|
4
|
+
"version": "5.0.2",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"putil-promisify": "^1.10.1",
|
|
18
18
|
"putil-varhelpers": "^1.7.0",
|
|
19
19
|
"strict-typed-events": "^2.8.0",
|
|
20
|
-
"ts-gems": "^3.
|
|
20
|
+
"ts-gems": "^3.12.0",
|
|
21
21
|
"tslib": "^2.8.1"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@sqb/builder": "^5.0.
|
|
24
|
+
"@sqb/builder": "^5.0.2",
|
|
25
25
|
"reflect-metadata": "^0.2.2"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|