@dbcube/core 5.2.5 → 5.2.6
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.cjs +23 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -618,6 +618,9 @@ var Binary = class {
|
|
|
618
618
|
return;
|
|
619
619
|
}
|
|
620
620
|
const binDir = this.getBinDir();
|
|
621
|
+
if (this.binariesPresent(binDir)) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
621
624
|
if (!this.isDownloading) {
|
|
622
625
|
this.isDownloading = true;
|
|
623
626
|
this.downloadPromise = this.downloadBinaries();
|
|
@@ -629,6 +632,17 @@ var Binary = class {
|
|
|
629
632
|
}
|
|
630
633
|
}
|
|
631
634
|
}
|
|
635
|
+
/** ¿Están ya presentes query-engine y schema-engine en binDir? */
|
|
636
|
+
static binariesPresent(binDir) {
|
|
637
|
+
try {
|
|
638
|
+
const files = fs2.readdirSync(binDir);
|
|
639
|
+
const hasQuery = files.some((f) => /^query-engine-/.test(f));
|
|
640
|
+
const hasSchema = files.some((f) => /^schema-engine-/.test(f));
|
|
641
|
+
return hasQuery && hasSchema;
|
|
642
|
+
} catch {
|
|
643
|
+
return false;
|
|
644
|
+
}
|
|
645
|
+
}
|
|
632
646
|
static async downloadBinaries() {
|
|
633
647
|
try {
|
|
634
648
|
const binDir = this.getBinDir();
|
|
@@ -1262,16 +1276,21 @@ var Engine = class {
|
|
|
1262
1276
|
}
|
|
1263
1277
|
return buffer;
|
|
1264
1278
|
};
|
|
1279
|
+
const showEngineOutput = process.env.DBCUBE_DEBUG === "1" || process.env.DBCUBE_DEBUG === "true";
|
|
1265
1280
|
child.stdout.on("data", (data) => {
|
|
1266
1281
|
const text = data.toString();
|
|
1267
|
-
|
|
1268
|
-
|
|
1282
|
+
if (showEngineOutput) {
|
|
1283
|
+
const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
|
|
1284
|
+
if (visible) console.log(visible);
|
|
1285
|
+
}
|
|
1269
1286
|
stdoutBuffer = tryParseLines(stdoutBuffer + text);
|
|
1270
1287
|
});
|
|
1271
1288
|
child.stderr.on("data", (data) => {
|
|
1272
1289
|
const text = data.toString();
|
|
1273
|
-
|
|
1274
|
-
|
|
1290
|
+
if (showEngineOutput) {
|
|
1291
|
+
const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
|
|
1292
|
+
if (visible) console.log(visible);
|
|
1293
|
+
}
|
|
1275
1294
|
stderrBuffer = tryParseLines(stderrBuffer + text);
|
|
1276
1295
|
});
|
|
1277
1296
|
child.on("close", (code) => {
|