@deepagents/text2sql 7.42.3 → 7.43.0

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.
@@ -1,8 +1,2 @@
1
- /**
2
- * Temporary workaround for a node-sql-parser 5.4.0 PostgreSQL grammar
3
- * shortcoming: it rejects valid typed string constants such as
4
- * `TIMESTAMPTZ 'epoch'`. Remove this module and its parser retry once
5
- * node-sql-parser supports PostgreSQL typed string constants natively.
6
- */
7
1
  export declare function recoverPostgresTypedLiteralParserGap(sql: string, error: unknown): string | null;
8
2
  //# sourceMappingURL=postgres-parser-workaround.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-parser-workaround.d.ts","sources":["../../../../src/lib/adapters/postgres/postgres-parser-workaround.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,IAAI,CA6Bf"}
1
+ {"version":3,"file":"postgres-parser-workaround.d.ts","sources":["../../../../src/lib/adapters/postgres/postgres-parser-workaround.ts"],"names":[],"mappings":"AAcA,wBAAgB,oCAAoC,CAClD,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACb,MAAM,GAAG,IAAI,CA6Bf"}
@@ -1 +1 @@
1
- {"version":3,"file":"column-stats.sqlserver.grounding.d.ts","sources":["../../../../src/lib/adapters/sqlserver/column-stats.sqlserver.grounding.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA0BzE,qBAAa,6BAA8B,SAAQ,oBAAoB;;IAIrE,YAAY,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,0BAA+B,EAGpE;IAEc,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D;IAsDD,UAAyB,YAAY,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAuDlC;CASF"}
1
+ {"version":3,"file":"column-stats.sqlserver.grounding.d.ts","sources":["../../../../src/lib/adapters/sqlserver/column-stats.sqlserver.grounding.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,KAAK,0BAA0B,EAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAuCzE,qBAAa,6BAA8B,SAAQ,oBAAoB;;IAIrE,YAAY,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,0BAA+B,EAGpE;IAEc,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG3D;IAuDD,UAAyB,YAAY,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAuDlC;CASF"}
@@ -1067,6 +1067,16 @@ var textValueRow = z2.object({ value: z2.string() });
1067
1067
  var numericValue = z2.union([z2.number(), z2.bigint(), z2.string()]);
1068
1068
 
1069
1069
  // packages/text2sql/src/lib/adapters/sqlserver/column-stats.sqlserver.grounding.ts
1070
+ var DistinctEstimatesWarning = class extends Error {
1071
+ code = "DEEPAGENTS_TEXT2SQL_SQLSERVER_DISTINCT_ESTIMATES_FAILED";
1072
+ constructor(failure) {
1073
+ super(
1074
+ `Reading the distinct-value estimates of the statistics histograms failed, and column stats go on without them: ${Error.isError(failure) ? failure.message : String(failure)}`,
1075
+ { cause: failure }
1076
+ );
1077
+ this.name = "DistinctEstimatesWarning";
1078
+ }
1079
+ };
1070
1080
  var nDistinctRow = z3.object({
1071
1081
  schema_name: z3.string().nullable(),
1072
1082
  table_name: z3.string().nullable(),
@@ -1131,7 +1141,8 @@ var SqlServerColumnStatsGrounding = class extends ColumnStatsGrounding {
1131
1141
  }
1132
1142
  map.set(row.column_name, nDistinct);
1133
1143
  }
1134
- } catch {
1144
+ } catch (error) {
1145
+ process.emitWarning(new DistinctEstimatesWarning(error));
1135
1146
  }
1136
1147
  }
1137
1148
  async collectStats(tableName, column2) {