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/README.md +10 -0
- package/dist/cli.js +24 -3
- package/dist/cli.js.map +3 -3
- package/dist/graph.d.ts +3 -0
- package/dist/index.js +24 -3
- package/dist/index.js.map +3 -3
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -80,6 +80,15 @@ graph.getTableColor("users") // "#3498db"
|
|
|
80
80
|
graph.getGroupColor("people") // "#3498db"
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
### Raw Graph Access
|
|
84
|
+
|
|
85
|
+
```typescript
|
|
86
|
+
const g = graph.getGraph() // graphology Graph copy
|
|
87
|
+
g.nodes() // all table names
|
|
88
|
+
g.edges() // all FK edges
|
|
89
|
+
g.forEachEdge((edge, attrs) => { /* custom traversal */ })
|
|
90
|
+
```
|
|
91
|
+
|
|
83
92
|
### All Methods
|
|
84
93
|
|
|
85
94
|
| Method | Returns | Description |
|
|
@@ -96,6 +105,7 @@ graph.getGroupColor("people") // "#3498db"
|
|
|
96
105
|
| `getNeighbors(name)` | `Neighbors` | One-hop parents and children |
|
|
97
106
|
| `getSummary()` | `GroupSummary[]` | Groups with table counts |
|
|
98
107
|
| `searchSchema(query)` | `SearchResult[]` | Substring search across names and notes |
|
|
108
|
+
| `getGraph()` | `Graph` | Copy of the underlying graphology graph for external analysis |
|
|
99
109
|
|
|
100
110
|
## CLI
|
|
101
111
|
|
package/dist/cli.js
CHANGED
|
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __returnValue = (v) => v;
|
|
35
|
+
function __exportSetter(name, newValue) {
|
|
36
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
+
}
|
|
20
38
|
var __export = (target, all) => {
|
|
21
39
|
for (var name in all)
|
|
22
40
|
__defProp(target, name, {
|
|
23
41
|
get: all[name],
|
|
24
42
|
enumerable: true,
|
|
25
43
|
configurable: true,
|
|
26
|
-
set: (
|
|
44
|
+
set: __exportSetter.bind(all, name)
|
|
27
45
|
});
|
|
28
46
|
};
|
|
29
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
@@ -17171,6 +17189,9 @@ class DbmlGraph {
|
|
|
17171
17189
|
}
|
|
17172
17190
|
return summary;
|
|
17173
17191
|
}
|
|
17192
|
+
getGraph() {
|
|
17193
|
+
return this.graph.copy();
|
|
17194
|
+
}
|
|
17174
17195
|
searchSchema(query) {
|
|
17175
17196
|
const q = query.toLowerCase();
|
|
17176
17197
|
const results = [];
|
|
@@ -17441,5 +17462,5 @@ switch (command) {
|
|
|
17441
17462
|
process.exit(1);
|
|
17442
17463
|
}
|
|
17443
17464
|
|
|
17444
|
-
//# debugId=
|
|
17465
|
+
//# debugId=DF0FACBFB677B9B164756E2164756E21
|
|
17445
17466
|
//# sourceMappingURL=cli.js.map
|