@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.d.mts CHANGED
@@ -228,6 +228,8 @@ export declare class Binary {
228
228
  private static downloadPromise;
229
229
  private static cachedBinaries;
230
230
  static ensureBinariesExist(): Promise<void>;
231
+ /** ¿Están ya presentes query-engine y schema-engine en binDir? */
232
+ private static binariesPresent;
231
233
  private static downloadBinaries;
232
234
  private static getBinDir;
233
235
  private static findVersionedBinary;
package/dist/index.d.ts CHANGED
@@ -228,6 +228,8 @@ export declare class Binary {
228
228
  private static downloadPromise;
229
229
  private static cachedBinaries;
230
230
  static ensureBinariesExist(): Promise<void>;
231
+ /** ¿Están ya presentes query-engine y schema-engine en binDir? */
232
+ private static binariesPresent;
231
233
  private static downloadBinaries;
232
234
  private static getBinDir;
233
235
  private static findVersionedBinary;
package/dist/index.js CHANGED
@@ -576,6 +576,9 @@ var Binary = class {
576
576
  return;
577
577
  }
578
578
  const binDir = this.getBinDir();
579
+ if (this.binariesPresent(binDir)) {
580
+ return;
581
+ }
579
582
  if (!this.isDownloading) {
580
583
  this.isDownloading = true;
581
584
  this.downloadPromise = this.downloadBinaries();
@@ -587,6 +590,17 @@ var Binary = class {
587
590
  }
588
591
  }
589
592
  }
593
+ /** ¿Están ya presentes query-engine y schema-engine en binDir? */
594
+ static binariesPresent(binDir) {
595
+ try {
596
+ const files = fs2.readdirSync(binDir);
597
+ const hasQuery = files.some((f) => /^query-engine-/.test(f));
598
+ const hasSchema = files.some((f) => /^schema-engine-/.test(f));
599
+ return hasQuery && hasSchema;
600
+ } catch {
601
+ return false;
602
+ }
603
+ }
590
604
  static async downloadBinaries() {
591
605
  try {
592
606
  const binDir = this.getBinDir();
@@ -1220,16 +1234,21 @@ var Engine = class {
1220
1234
  }
1221
1235
  return buffer;
1222
1236
  };
1237
+ const showEngineOutput = process.env.DBCUBE_DEBUG === "1" || process.env.DBCUBE_DEBUG === "true";
1223
1238
  child.stdout.on("data", (data) => {
1224
1239
  const text = data.toString();
1225
- const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
1226
- if (visible) console.log(visible);
1240
+ if (showEngineOutput) {
1241
+ const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
1242
+ if (visible) console.log(visible);
1243
+ }
1227
1244
  stdoutBuffer = tryParseLines(stdoutBuffer + text);
1228
1245
  });
1229
1246
  child.stderr.on("data", (data) => {
1230
1247
  const text = data.toString();
1231
- const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
1232
- if (visible) console.log(visible);
1248
+ if (showEngineOutput) {
1249
+ const visible = text.split("\n").filter((l) => l.trim() && !l.includes("PROCESS_RESPONSE:")).join("\n");
1250
+ if (visible) console.log(visible);
1251
+ }
1233
1252
  stderrBuffer = tryParseLines(stderrBuffer + text);
1234
1253
  });
1235
1254
  child.on("close", (code) => {