db_get_relationships
Retrieve the foreign key relationship graph for any table up to a specified traversal depth to understand join paths and plan multi-table queries.
Instructions
Get the foreign key relationship graph for a table up to the given traversal depth.
Depth 1 returns direct neighbors (tables one JOIN away). Depth 2 returns
neighbors-of-neighbors. Returns both a flat neighbor list and formatted join
path strings to help plan multi-table queries. Requires db_discover_relationships
to have been run first.
Args:
table: Table name (e.g. "Orders").
connection: Connection name. Defaults to first defined.
depth: BFS traversal depth (default 1, recommended max 3).
Returns:
{table, connection, neighbors: [...], paths: ["TableA -> TableB -> TableC", ...]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| connection | No | ||
| depth | No |