@deepagents/text2sql 6.1.0 → 6.1.2

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.js CHANGED
@@ -439,6 +439,9 @@ var Adapter = class {
439
439
  return this.validateImpl(decoded);
440
440
  }
441
441
  async execute(sql) {
442
+ return this.executeImpl(await this.enforceExecutionPolicy(sql));
443
+ }
444
+ async enforceExecutionPolicy(sql) {
442
445
  const decoded = this.#decodeShellEscapes(sql);
443
446
  const violation = await this.#analyzePolicy(decoded);
444
447
  if (violation?.kind === "read-only") {
@@ -447,7 +450,7 @@ var Adapter = class {
447
450
  if (violation?.kind === "scope") {
448
451
  throw new SQLScopeError(violation.payload);
449
452
  }
450
- return this.executeImpl(decoded);
453
+ return decoded;
451
454
  }
452
455
  /**
453
456
  * Convert unknown database value to number.