gograph_sql
Locate all SQL query literals in Go source code with function context and file/line positions. Optionally filter by SQL keyword or table name to audit database interactions.
Instructions
Find all SQL query literals embedded in Go source code, with their enclosing function context and file/line locations. Requires .gograph/graph.json — run gograph build . first. Read-only; no side effects. Optional term filters by SQL keyword or table name (e.g., "SELECT", "users"). WHEN TO USE: When auditing database interactions, reviewing queries for performance issues, or locating all queries that touch a specific table. NOT TO USE: For ORM struct-to-table mappings (use gograph_schema); for env-based configuration (use gograph_envs). RETURNS: List of SQL string literals with file, line, and enclosing function name; empty when no matches found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| term | No | Optional SQL keyword or table name to filter database queries (e.g., 'SELECT', 'users') |