sql2viz

Crates.iosql2viz
lib.rssql2viz
version0.2.0
created_at2025-10-18 07:11:24.449451+00
updated_at2025-11-03 02:42:42.584095+00
descriptionTransform SQL queries into beautiful visualizations with DuckDB and Iced
homepage
repositoryhttps://github.com/nkwork9999/sql2viz
max_upload_size
id1888904
size2,023,082
nk(Enuke) (nkwork9999)

documentation

README

sql2viz

Transform Raw SQL queries into visualizations using DuckDB and Iced.

Installation

[dependencies]
sql2viz = { version = "0.1", features = ["gui"] }

Usage

use sql2viz::vizcreate;

fn main() {
    let query = "SELECT 'A' as x, 10 as y UNION ALL SELECT 'B', 20";
    vizcreate(query.to_string()).unwrap();
}

Example with Database and CSV

use sql2viz::vizcreate;

fn main() {
    let queries = "
-- Connect to existing database
ATTACH 'mydata.db' AS mydb;

-- Query 1: Sales summary by category
SELECT category, SUM(amount) as total_sales
FROM mydb.sales
GROUP BY category
ORDER BY total_sales DESC;

-- Query 2: Load CSV file
SELECT * FROM 'test.csv' LIMIT 100;
";

    vizcreate(queries.to_string()).unwrap();
}

Screenshots

Table View

Chart View

Multiple Tabs

Features

  • SQL query execution with DuckDB
  • Interactive charts (Bar, Line, Area, Scatter)
  • Table view
  • Column selection for chart axes

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt