QUERY VISUALIZE UNDERSTAND
ggsql brings the elegance of the Grammar of Graphics to SQL. Write familiar queries, add visualization clauses, and see your data transform into beautiful, composable charts — no context switching, no separate tools, just SQL with superpowers.
Try it out
-- Regular query
SELECT * FROM ggsql:penguins
WHERE island = 'Biscoe'
-- Followed by visualization declaration
VISUALISE bill_len AS x, bill_dep AS y, body_mass AS fill
DRAW point
PLACE rule
SETTING slope => 0.4, y => -1
SCALE BINNED fill
LABEL
title => 'Relationship between bill dimensions in 3 species of penguins',
x => 'Bill length (mm)',
y => 'Bill depth (mm)'Explore the examples
Install it today
or
# Jupyter kernel (PyPI)
uv tool install ggsql-jupyter
ggsql-jupyter --install
# CLI (crates.io)
cargo install ggsql-cliFeatures
Familiar syntax
Write standard SQL queries and seamlessly extend them with visualization clauses. Your existing SQL knowledge transfers directly.
SELECT date, revenue, region
FROM sales
WHERE year = 2024
VISUALISE date AS x, revenue AS y
DRAW lineGrammar of graphics
Compose visualizations from independent layers, scales, and coordinates. Mix and match components for powerful custom visuals. The grammar of graphics provides you with a single mental model for every type of plot.
VISUALISE date AS x FROM sales
DRAW bar
SCALE BINNED x
SETTING breaks => 'weeks'
FACET regionBuilt for humans and AI
The structured syntax makes it easy for AI agents to write, and for you to read, adjust, and verify.
You also avoid needing agents to launch full programming languages like Python or R to create powerful visualizations, so you can rest assured that the agent doesn’t accidentally alter your environment in unwanted ways.
Connect directly to your data
ggsql interfaces directly with your database. Want to create a histogram over 1 billion observations? No problem! All calculations are pushed to the database so you only extract what is needed for the visual.
Available where your data is
Ready to get started?
Install ggsql and start creating visualizations in minutes.
Or try our online playground to experience the syntax right now.