whats-up-dug 0.4.1 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -49296,12 +49296,26 @@ class HarperClient {
49296
49296
  throw new Error(`Database "${database}" not found`);
49297
49297
  }
49298
49298
  async fetchSchemaDirectly(schemaName) {
49299
- const raw = await this.execute({ operation: "describe_schema", schema: schemaName });
49299
+ let raw;
49300
49300
  try {
49301
- return exports_external.record(exports_external.string(), TableSchemaSchema).parse(raw);
49301
+ raw = await this.execute({ operation: "describe_schema", schema: schemaName });
49302
49302
  } catch {
49303
49303
  return null;
49304
49304
  }
49305
+ const tableRecord = exports_external.record(exports_external.string(), TableSchemaSchema);
49306
+ try {
49307
+ const parsed = tableRecord.parse(raw);
49308
+ if (Object.keys(parsed).length > 0)
49309
+ return parsed;
49310
+ } catch {}
49311
+ if (raw && typeof raw === "object" && schemaName in raw) {
49312
+ try {
49313
+ const parsed = tableRecord.parse(raw[schemaName]);
49314
+ if (Object.keys(parsed).length > 0)
49315
+ return parsed;
49316
+ } catch {}
49317
+ }
49318
+ return null;
49305
49319
  }
49306
49320
  async describeTable(database, table) {
49307
49321
  const cacheKey = `describe_table:${database}.${table}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whats-up-dug",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "Interactive data exploration CLI for Harper",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",