db_discover_relationships
Discover all foreign key relationships in your database and persist them to the local graph for efficient JOIN query planning.
Instructions
Discover all foreign key relationships in the database and save them to the graph.
Runs driver-specific FK introspection queries against the live database and
persists results to the local KnowledgeStore. Run once per database; re-run
after schema changes. After discovery, use db_get_relationships to navigate
the graph when planning complex JOIN queries.
Args:
connection: Connection name. Defaults to first defined.
Returns:
{connection, discovered: count, relationships: [{from_table, from_column, to_table, to_column}]}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No |