rake-db 2.8.30 → 2.8.32
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/dist/index.d.ts +6 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -2979,7 +2979,20 @@ const createView = (ast) => {
|
|
|
2979
2979
|
}
|
|
2980
2980
|
addCode(code, ", ");
|
|
2981
2981
|
if (!ast.sql.__values) {
|
|
2982
|
-
|
|
2982
|
+
const raw = ast.sql.__raw;
|
|
2983
|
+
let sql;
|
|
2984
|
+
if (typeof raw === "string") {
|
|
2985
|
+
sql = raw;
|
|
2986
|
+
} else {
|
|
2987
|
+
sql = "";
|
|
2988
|
+
const parts = raw[0];
|
|
2989
|
+
const last = parts.length - 1;
|
|
2990
|
+
for (let i = 0; i < last; i++) {
|
|
2991
|
+
sql += parts[i] + `\${${raw[i + 1]}}`;
|
|
2992
|
+
}
|
|
2993
|
+
sql += parts[last];
|
|
2994
|
+
}
|
|
2995
|
+
addCode(code, backtickQuote(sql));
|
|
2983
2996
|
} else {
|
|
2984
2997
|
addCode(code, rawToCode("db", ast.sql));
|
|
2985
2998
|
}
|