
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
dbml-metaquery
Advanced tools
Parse DBML into a navigable graph with rich metadata -- FK path finding, table info, groups, and schema search.
Parse DBML into a navigable graph with rich metadata -- FK path finding, table info, groups, and schema search.
Uses @dbml/parse for correct handling of all DBML syntax.
npm install dbml-metaquery
# or
bun add dbml-metaquery
import { DbmlGraph } from "dbml-metaquery"
import { readFileSync } from "fs"
const dbml = readFileSync("model.dbml", "utf-8")
const graph = new DbmlGraph(dbml)
graph.findPath("order_items", "users")
// [
// { from: { table: "order_items", column: "order_id" }, to: { table: "orders", column: "id" } },
// { from: { table: "orders", column: "user_id" }, to: { table: "users", column: "id" } },
// ]
graph.getTable("orders")
// {
// name: "orders",
// note: "Customer orders",
// columns: [
// { name: "id", type: "INTEGER" },
// { name: "user_id", type: "INTEGER", fk: { table: "users", column: "id" } },
// { name: "product", type: "VARCHAR", note: "Product name" },
// ...
// ]
// }
// What tables reference users?
graph.getReferencingTables("users")
// [{ table: "orders", column: "user_id", myColumn: "id" }, ...]
// What's directly connected to orders?
graph.getNeighbors("orders")
// {
// parents: [{ table: "users", via: "user_id" }],
// children: [{ table: "order_items", via: "order_id" }]
// }
// Schema overview
graph.getSummary()
// [{ name: "people", tableCount: 2, tables: ["users", "departments"] }, ...]
// Search across table/column names and notes
graph.searchSchema("order")
// [{ table: "orders", match: "table_name", text: "orders" }, ...]
graph.getGroups() // all TableGroups with member tables
graph.getGroup("users") // { name: "people", tables: ["users", "departments"] }
graph.getTableColor("users") // "#3498db"
graph.getGroupColor("people") // "#3498db"
| Method | Returns | Description |
|---|---|---|
findPath(from, to) | PathStep[] | null | Shortest FK path between two tables |
getTables() | string[] | All table names, sorted |
getRelationships(table?) | Relationship[] | FK relationships, optionally filtered |
getTable(name) | TableInfo | undefined | Table note, columns with types/notes/FKs |
getGroups() | GroupInfo[] | All TableGroups with member tables |
getGroup(tableName) | GroupInfo | undefined | Which group a table belongs to |
getTableColor(name) | string | undefined | Table headercolor |
getGroupColor(name) | string | undefined | Group color |
getReferencingTables(name) | ReferencingTable[] | Tables that FK into this table |
getNeighbors(name) | Neighbors | One-hop parents and children |
getSummary() | GroupSummary[] | Groups with table counts |
searchSchema(query) | SearchResult[] | Substring search across names and notes |
The first argument is always the path to a .dbml file, followed by a command.
dbml-metaquery model.dbml find-path <from> <to> # Shortest FK path
dbml-metaquery model.dbml info <table> # Table metadata
dbml-metaquery model.dbml neighbors <table> # Directly connected tables
dbml-metaquery model.dbml refs-to <table> # Tables that FK into this table
dbml-metaquery model.dbml rels <table> # All FK relationships
dbml-metaquery model.dbml search <query> # Search names and notes
dbml-metaquery model.dbml summary # Schema overview
dbml-metaquery model.dbml tables # List all tables
MIT
FAQs
Parse DBML into a navigable graph with rich metadata -- FK path finding, table info, groups, and schema search.
The npm package dbml-metaquery receives a total of 0 weekly downloads. As such, dbml-metaquery popularity was classified as not popular.
We found that dbml-metaquery demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.