dbml-metaquery 0.1.0 → 1.1.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.
package/dist/graph.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * DbmlGraph -- parses DBML via @dbml/parse, builds a graphology graph,
3
3
  * and provides FK path finding + rich schema metadata.
4
4
  */
5
+ import Graph from "graphology";
5
6
  import type { PathStep, Relationship, TableInfo, GroupInfo, ReferencingTable, Neighbors, GroupSummary, SearchResult } from "./types";
6
7
  export declare class DbmlGraph {
7
8
  private graph;
@@ -39,6 +40,8 @@ export declare class DbmlGraph {
39
40
  getNeighbors(tableName: string): Neighbors;
40
41
  /** High-level schema overview: groups with table counts, plus ungrouped tables. */
41
42
  getSummary(): GroupSummary[];
43
+ /** Get a copy of the underlying graphology graph for external analysis. */
44
+ getGraph(): Graph;
42
45
  /** Case-insensitive substring search across table names, notes, column names, and column notes. */
43
46
  searchSchema(query: string): SearchResult[];
44
47
  private findEdgeStep;
package/dist/index.js CHANGED
@@ -4,25 +4,43 @@ var __getProtoOf = Object.getPrototypeOf;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
7
12
  var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
8
20
  target = mod != null ? __create(__getProtoOf(mod)) : {};
9
21
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
10
22
  for (let key of __getOwnPropNames(mod))
11
23
  if (!__hasOwnProp.call(to, key))
12
24
  __defProp(to, key, {
13
- get: () => mod[key],
25
+ get: __accessProp.bind(mod, key),
14
26
  enumerable: true
15
27
  });
28
+ if (canCache)
29
+ cache.set(mod, to);
16
30
  return to;
17
31
  };
18
32
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
19
37
  var __export = (target, all) => {
20
38
  for (var name in all)
21
39
  __defProp(target, name, {
22
40
  get: all[name],
23
41
  enumerable: true,
24
42
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
43
+ set: __exportSetter.bind(all, name)
26
44
  });
27
45
  };
28
46
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
@@ -17166,6 +17184,9 @@ class DbmlGraph {
17166
17184
  }
17167
17185
  return summary;
17168
17186
  }
17187
+ getGraph() {
17188
+ return this.graph.copy();
17189
+ }
17169
17190
  searchSchema(query) {
17170
17191
  const q = query.toLowerCase();
17171
17192
  const results = [];
@@ -17211,5 +17232,5 @@ export {
17211
17232
  DbmlGraph
17212
17233
  };
17213
17234
 
17214
- //# debugId=E845D053A77E9A2964756E2164756E21
17235
+ //# debugId=EEE4AFBA9A3028D864756E2164756E21
17215
17236
  //# sourceMappingURL=index.js.map