Prompts for AI-powered SQL query explanations.
Summary
Functions
Build the user prompt for explaining a fragment in context of the full query.
Generate system prompt for query explanation.
Build the user prompt for a full query explanation.
Functions
Build the user prompt for explaining a fragment in context of the full query.
The fragment is the portion the user highlighted/selected. The full query provides necessary context so the LLM can explain even isolated terms (e.g., a single JOIN clause, a HAVING condition, or a function call).
Parameters
fragment- The selected fragment to explainfull_sql- The complete query for contextsource_context- Optional source context stringfence- Markdown fence label for the statement blocks, fromLotus.AI.Prompts.AdapterNotes.fence_label/1
Generate system prompt for query explanation.
Parameters
database_type- Database type (e.g., :postgres, :mysql, :sqlite)
Build the user prompt for a full query explanation.
Parameters
sql- The full query to explainsource_context- Optional source context stringfence- Markdown fence label for the statement block, fromLotus.AI.Prompts.AdapterNotes.fence_label/1