orange-orm 4.7.15-beta.0 → 4.7.15-beta.1
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/README.md +4 -4
- package/dist/index.mjs +3 -4
- package/package.json +1 -1
- package/src/mssql/wrapQuery.js +3 -4
package/README.md
CHANGED
|
@@ -223,9 +223,9 @@ import map from './map';
|
|
|
223
223
|
const db = map.sqlite('demo.db');
|
|
224
224
|
|
|
225
225
|
const sql = `DROP TABLE IF EXISTS deliveryAddress;
|
|
226
|
-
DROP TABLE IF EXISTS package;
|
|
227
|
-
DROP TABLE IF EXISTS orderLine;
|
|
228
|
-
DROP TABLE IF EXISTS _order;
|
|
226
|
+
DROP TABLE IF EXISTS package;
|
|
227
|
+
DROP TABLE IF EXISTS orderLine;
|
|
228
|
+
DROP TABLE IF EXISTS _order;
|
|
229
229
|
DROP TABLE IF EXISTS customer;
|
|
230
230
|
|
|
231
231
|
CREATE TABLE customer (
|
|
@@ -936,7 +936,7 @@ async function update() {
|
|
|
936
936
|
```
|
|
937
937
|
</details>
|
|
938
938
|
|
|
939
|
-
<details><summary><strong>Upserting rows</strong></summary>
|
|
939
|
+
<details id="upserting-rows"><summary><strong>Upserting rows</strong></summary>
|
|
940
940
|
It is possible to perform 'upserts' by taking advantage of the 'overwrite' strategy.
|
|
941
941
|
|
|
942
942
|
Currently, there are three concurrency strategies:
|
package/dist/index.mjs
CHANGED
|
@@ -17739,7 +17739,6 @@ function requireWrapQuery$2 () {
|
|
|
17739
17739
|
const parameter = params[i];
|
|
17740
17740
|
|
|
17741
17741
|
if (typeof parameter === 'string') {
|
|
17742
|
-
const paramLength = parameter.length;
|
|
17743
17742
|
const byteLength = Buffer.from(parameter, 'utf8').length;
|
|
17744
17743
|
|
|
17745
17744
|
if (hasNonAsciiCharacters(parameter)) {
|
|
@@ -17748,10 +17747,10 @@ function requireWrapQuery$2 () {
|
|
|
17748
17747
|
if (isStoredProcCall) {
|
|
17749
17748
|
// For stored procedures, create a variable with exact lengths
|
|
17750
17749
|
const varName = `@hex_param_${i}`;
|
|
17751
|
-
const convertClause = `CONVERT(VARCHAR(${
|
|
17750
|
+
const convertClause = `CONVERT(VARCHAR(${byteLength}), CONVERT(VARBINARY(${byteLength}), 0x${hexValue}))`;
|
|
17752
17751
|
|
|
17753
17752
|
hexVariables.push({
|
|
17754
|
-
declaration: `DECLARE ${varName} VARCHAR(${
|
|
17753
|
+
declaration: `DECLARE ${varName} VARCHAR(${byteLength})`,
|
|
17755
17754
|
assignment: `SET ${varName} = ${convertClause}`
|
|
17756
17755
|
});
|
|
17757
17756
|
|
|
@@ -17761,7 +17760,7 @@ function requireWrapQuery$2 () {
|
|
|
17761
17760
|
});
|
|
17762
17761
|
} else {
|
|
17763
17762
|
// For regular queries, use inline conversion with exact lengths
|
|
17764
|
-
const convertClause = `CONVERT(VARCHAR(${
|
|
17763
|
+
const convertClause = `CONVERT(VARCHAR(${byteLength}), CONVERT(VARBINARY(${byteLength}), 0x${hexValue}))`;
|
|
17765
17764
|
replacements.push({
|
|
17766
17765
|
index: i,
|
|
17767
17766
|
replacement: convertClause
|
package/package.json
CHANGED
package/src/mssql/wrapQuery.js
CHANGED
|
@@ -26,7 +26,6 @@ function wrapQuery(_context, connection) {
|
|
|
26
26
|
const parameter = params[i];
|
|
27
27
|
|
|
28
28
|
if (typeof parameter === 'string') {
|
|
29
|
-
const paramLength = parameter.length;
|
|
30
29
|
const byteLength = Buffer.from(parameter, 'utf8').length;
|
|
31
30
|
|
|
32
31
|
if (hasNonAsciiCharacters(parameter)) {
|
|
@@ -35,10 +34,10 @@ function wrapQuery(_context, connection) {
|
|
|
35
34
|
if (isStoredProcCall) {
|
|
36
35
|
// For stored procedures, create a variable with exact lengths
|
|
37
36
|
const varName = `@hex_param_${i}`;
|
|
38
|
-
const convertClause = `CONVERT(VARCHAR(${
|
|
37
|
+
const convertClause = `CONVERT(VARCHAR(${byteLength}), CONVERT(VARBINARY(${byteLength}), 0x${hexValue}))`;
|
|
39
38
|
|
|
40
39
|
hexVariables.push({
|
|
41
|
-
declaration: `DECLARE ${varName} VARCHAR(${
|
|
40
|
+
declaration: `DECLARE ${varName} VARCHAR(${byteLength})`,
|
|
42
41
|
assignment: `SET ${varName} = ${convertClause}`
|
|
43
42
|
});
|
|
44
43
|
|
|
@@ -48,7 +47,7 @@ function wrapQuery(_context, connection) {
|
|
|
48
47
|
});
|
|
49
48
|
} else {
|
|
50
49
|
// For regular queries, use inline conversion with exact lengths
|
|
51
|
-
const convertClause = `CONVERT(VARCHAR(${
|
|
50
|
+
const convertClause = `CONVERT(VARCHAR(${byteLength}), CONVERT(VARBINARY(${byteLength}), 0x${hexValue}))`;
|
|
52
51
|
replacements.push({
|
|
53
52
|
index: i,
|
|
54
53
|
replacement: convertClause
|