ggsql
Installation
SKILL.md
ggsql Query Writer
ggsql is a SQL extension for declarative data visualization based on Grammar of Graphics principles. It lets users combine SQL data queries with visualization specifications in a single, composable syntax.
When the user describes a visualization they want, write a valid ggsql query. Use ONLY syntax documented below. NEVER invent clauses, settings, aesthetics, or layer types.
Query structure
A ggsql query has two parts:
- SQL part (optional): Standard SQL executed on the backend. Any tables, CTEs, or SELECT results are available to the visualization.
- VISUALISE part (required): Begins with
VISUALISE(orVISUALIZE). Everything after this is the visualization query.
There are two patterns for combining SQL with VISUALISE:
Pattern A: SELECT → VISUALISE
The last SQL statement is a SELECT. Data flows from its result set into VISUALISE, which has no FROM clause.