ggsql is still in early development and all functionality is subject to change

A declarative visualization language that extends SQL with powerful data visualization capabilities.
Write standard SQL queries and seamlessly extend them with visualization clauses. Your existing SQL knowledge transfers directly.
Compose visualizations from independent layers, scales, and coordinates. Mix and match geoms, facets, and themes for precise control.
Connect to DuckDB, PostgreSQL, or SQLite. Output to Vega-Lite, ggplot2, or render directly to PNG.
Interactive notebooks with inline Vega-Lite visualizations. Persistent database sessions across cells.
Syntax highlighting for .ggsql files with full SQL and visualization clause support.
Build dashboards and web applications with the ggsql-rest server. CORS-enabled with sample data loading.
Parse, validate, and execute queries from the command line. Perfect for automation and CI pipelines.
-- Create a multi-layer visualization
SELECT date, revenue, region
FROM sales
WHERE year >= 2023
VISUALISE date AS x, revenue AS y, region AS color
DRAW line
DRAW point
SETTING size => 3
SCALE x
SETTING type => 'date'
SCALE y
SETTING type => 'linear', limits => [0, 100000]
FACET WRAP region SETTING scales => 'free_y'
LABEL
title => 'Revenue Trends by Region',
x => 'Date',
y => 'Revenue (USD)'The output is a Vega-Lite specification that renders as an interactive chart.
Install ggsql and start creating visualizations in minutes.