gograph_sql
Extract SQL query literals from Go source code with their enclosing function context and file locations. Filter results by keyword or table name to find specific queries.
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') |