Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

4 Commits

Repository files navigation

LSQL

Visual SQL query builder for your CSV files. Drop CSVs into the browser, get a live schema with inferred relationships, and build real SELECT queries by clicking — no SQL typing required. Every query runs against an in-memory SQLite database and returns real rows plus the exact SQL it generated.

Features

  • Drag-and-drop CSV ingestion — parse multiple files at once, add more incrementally. Delimiter (,; tab |), quoted fields, and BOM handled automatically.
  • Automatic schema inference — column types (INTEGER / REAL / TEXT), primary keys (an INTEGER id column), and foreign keys detected from <name>_id<name>s naming heuristics.
  • Visual query builder — pick FROM, add JOINs (INNER / LEFT / RIGHT), SELECT columns with aggregates (COUNT/SUM/AVG/MIN/MAX), WHERE conditions (AND/OR), GROUP BY, ORDER BY, LIMIT, and DISTINCT.
  • Query graph — see tables and their join relationships visualized.
  • Generated SQL + live results — the SQL is shown and results returned (capped at 1,000 rows for display) with query timing.
  • Safe by design — the client only sends a structured query model; SQL is rebuilt on the server, SELECT-only. No raw SQL from the client is ever executed.
  • Light / dark theme.

How it works

  1. You drop CSV files. The server parses them, infers column types and foreign keys, and loads the rows (up to 100k per table) into a fresh in-memory SQLite database (Node's built-in node:sqlite), one per session.
  2. As you build a query in the UI, a structured Query object is maintained.
  3. On run, the server turns that model into a parameter-free SELECT statement, executes it, and returns the columns, rows, and elapsed time.

Nothing is persisted — each upload session lives in memory and disappears when the server restarts.

Getting started

Requires Node.js 22+ (for the built-in node:sqlite module).

cd web
npm install
npm run dev

Open http://localhost:3000 and drop in some CSVs. The samples/ directory ships a small e-commerce dataset (customers, orders, order_items, products, categories, employees, shipments, reviews) with ready-made relationships to try joins.

Scripts

CommandAction
npm run devStart the dev server
npm run buildProduction build
npm run startServe the production build
npm run lintLint

Tech stack

  • Next.js 15 (App Router) + React 19
  • Node.js built-in node:sqlite — no external database
  • Tailwind CSS 4 + shadcn/ui (Radix primitives)

Limits

  • Max 20 MB per CSV file, 100,000 rows loaded per table.
  • 1,000 rows returned per query (results are truncated for display, not the underlying query).
  • Foreign keys are inferred from naming conventions, so unusually named columns may not auto-link — you can still join them manually.

Project layout

web/ Next.js app (UI + API + SQLite/CSV engine)
samples/ Example e-commerce CSV dataset

About

🖱️ Point-and-click SQL query builder. Drop CSVs, get auto-inferred schema + joins, see real results and generated SQL

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages