dbml-metaquery 0.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 +117 -0
- package/dist/cli.js +17445 -0
- package/dist/cli.js.map +32 -0
- package/dist/graph.d.ts +45 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17215 -0
- package/dist/index.js.map +31 -0
- package/dist/types.d.ts +63 -0
- package/package.json +44 -0
- package/src/cli.ts +271 -0
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DbmlGraph -- parses DBML via @dbml/parse, builds a graphology graph,
|
|
3
|
+
* and provides FK path finding + rich schema metadata.
|
|
4
|
+
*/
|
|
5
|
+
import type { PathStep, Relationship, TableInfo, GroupInfo, ReferencingTable, Neighbors, GroupSummary, SearchResult } from "./types";
|
|
6
|
+
export declare class DbmlGraph {
|
|
7
|
+
private graph;
|
|
8
|
+
private relationships;
|
|
9
|
+
private tableSet;
|
|
10
|
+
private tableInfoMap;
|
|
11
|
+
private tableColorMap;
|
|
12
|
+
private groupList;
|
|
13
|
+
private tableToGroup;
|
|
14
|
+
private groupColorMap;
|
|
15
|
+
constructor(dbml: string);
|
|
16
|
+
/**
|
|
17
|
+
* Find the shortest FK path between two tables.
|
|
18
|
+
* Returns PathStep[] representing each JOIN hop, or null if unreachable.
|
|
19
|
+
* Returns empty array if from === to.
|
|
20
|
+
*/
|
|
21
|
+
findPath(from: string, to: string): PathStep[] | null;
|
|
22
|
+
/** Get all table names in the graph. */
|
|
23
|
+
getTables(): string[];
|
|
24
|
+
/** Get FK relationships, optionally filtered to those involving a specific table. */
|
|
25
|
+
getRelationships(table?: string): Relationship[];
|
|
26
|
+
/** Get data-relevant info for a table: name, note, columns with types/notes/FK. */
|
|
27
|
+
getTable(name: string): TableInfo | undefined;
|
|
28
|
+
/** Get all TableGroups with names and member tables. */
|
|
29
|
+
getGroups(): GroupInfo[];
|
|
30
|
+
/** Get the group that contains a given table. */
|
|
31
|
+
getGroup(tableName: string): GroupInfo | undefined;
|
|
32
|
+
/** Get the headercolor for a table. */
|
|
33
|
+
getTableColor(name: string): string | undefined;
|
|
34
|
+
/** Get the color for a group. */
|
|
35
|
+
getGroupColor(name: string): string | undefined;
|
|
36
|
+
/** Get tables that have FK columns pointing at the given table. */
|
|
37
|
+
getReferencingTables(tableName: string): ReferencingTable[];
|
|
38
|
+
/** Get one-hop connections: parents (tables I FK to) and children (tables that FK to me). */
|
|
39
|
+
getNeighbors(tableName: string): Neighbors;
|
|
40
|
+
/** High-level schema overview: groups with table counts, plus ungrouped tables. */
|
|
41
|
+
getSummary(): GroupSummary[];
|
|
42
|
+
/** Case-insensitive substring search across table names, notes, column names, and column notes. */
|
|
43
|
+
searchSchema(query: string): SearchResult[];
|
|
44
|
+
private findEdgeStep;
|
|
45
|
+
}
|
package/dist/index.d.ts
ADDED