latticesql 1.6.6 → 1.6.7
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/cli.js +6 -0
- package/dist/index.cjs +6 -0
- package/dist/index.js +6 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -566,6 +566,12 @@ function translateDialect(sql) {
|
|
|
566
566
|
if (hadInsertOrIgnore && !hasOnConflictInCode(s)) {
|
|
567
567
|
s = s.replace(/(\s*;?\s*)$/, " ON CONFLICT DO NOTHING$1");
|
|
568
568
|
}
|
|
569
|
+
s = mapCodeRegions(
|
|
570
|
+
s,
|
|
571
|
+
(code) => code.replace(/CREATE(\s+)VIEW(\s+)IF\s+NOT\s+EXISTS/gi, (_m, w1, _w2) => {
|
|
572
|
+
return `CREATE${w1}OR REPLACE VIEW`;
|
|
573
|
+
})
|
|
574
|
+
);
|
|
569
575
|
s = replaceFunction(s, "hex", (arg) => `encode(${arg}, 'hex')`);
|
|
570
576
|
s = replaceFunction(s, "randomblob", (arg) => `gen_random_bytes(${arg})`);
|
|
571
577
|
return s;
|
package/dist/index.cjs
CHANGED
|
@@ -316,6 +316,12 @@ function translateDialect(sql) {
|
|
|
316
316
|
if (hadInsertOrIgnore && !hasOnConflictInCode(s)) {
|
|
317
317
|
s = s.replace(/(\s*;?\s*)$/, " ON CONFLICT DO NOTHING$1");
|
|
318
318
|
}
|
|
319
|
+
s = mapCodeRegions(
|
|
320
|
+
s,
|
|
321
|
+
(code) => code.replace(/CREATE(\s+)VIEW(\s+)IF\s+NOT\s+EXISTS/gi, (_m, w1, _w2) => {
|
|
322
|
+
return `CREATE${w1}OR REPLACE VIEW`;
|
|
323
|
+
})
|
|
324
|
+
);
|
|
319
325
|
s = replaceFunction(s, "hex", (arg) => `encode(${arg}, 'hex')`);
|
|
320
326
|
s = replaceFunction(s, "randomblob", (arg) => `gen_random_bytes(${arg})`);
|
|
321
327
|
return s;
|
package/dist/index.js
CHANGED
|
@@ -251,6 +251,12 @@ function translateDialect(sql) {
|
|
|
251
251
|
if (hadInsertOrIgnore && !hasOnConflictInCode(s)) {
|
|
252
252
|
s = s.replace(/(\s*;?\s*)$/, " ON CONFLICT DO NOTHING$1");
|
|
253
253
|
}
|
|
254
|
+
s = mapCodeRegions(
|
|
255
|
+
s,
|
|
256
|
+
(code) => code.replace(/CREATE(\s+)VIEW(\s+)IF\s+NOT\s+EXISTS/gi, (_m, w1, _w2) => {
|
|
257
|
+
return `CREATE${w1}OR REPLACE VIEW`;
|
|
258
|
+
})
|
|
259
|
+
);
|
|
254
260
|
s = replaceFunction(s, "hex", (arg) => `encode(${arg}, 'hex')`);
|
|
255
261
|
s = replaceFunction(s, "randomblob", (arg) => `gen_random_bytes(${arg})`);
|
|
256
262
|
return s;
|
package/package.json
CHANGED