This repo ships multiple binaries under cmd/ for different use-cases.
demo
A simple demo that creates tables, inserts sample data, and runs example queries.
Build: go build ./cmd/demo
Run: ./demo -dsn "mem://?tenant=default"
repl
Interactive SQL REPL on top of database/sql. Supports multiple output formats (table, csv, tsv, json, yaml, markdown), echo mode, and optional HTML output.
SQLite-compatible CLI with file-based and in-memory database support. Accepts a filename as the database path (:memory: for in-memory), optional inline SQL as a positional argument, and supports utility subcommands (tables, schema, insert, query, export).
Build: go build ./cmd/tinysql
Run interactive REPL: ./tinysql mydb.dat
Run inline SQL: ./tinysql mydb.dat "SELECT * FROM users"
HTTP server that renders SQL-driven web pages. Each URL path maps to a .sql file in the pages directory; query results are turned into HTML components and served via a template.
Desktop GUI application built with Wails. Provides a native window for running SQL queries against tinySQL.
Requires Wails CLI: go install github.com/wailsapp/wails/v2/cmd/wails@latest
Build: cd cmd/studio && wails build
Dev mode: cd cmd/studio && wails dev
wasm_browser
Builds tinySQL to WebAssembly for browsers. A modern UI is provided in web/.
Build only: cd cmd/wasm_browser && ./build.sh --build-only
Build & serve: cd cmd/wasm_browser && ./build.sh --serve then open http://localhost:8080
Manual build: cd cmd/wasm_browser && GOOS=js GOARCH=wasm go build -o web/tinySQL.wasm . && cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" web/
wasm_node
Builds tinySQL to WebAssembly for Node.js and provides a Node runner.
Build only: cd cmd/wasm_node && ./build.sh --build-only
Build & run demo: cd cmd/wasm_node && ./build.sh --run
Manual build: cd cmd/wasm_node && GOOS=js GOARCH=wasm go build -o tinySQL.wasm . && cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" ./
Run: node wasm_runner.js or node wasm_runner.js query "SELECT 1"
query_files
Query CSV, JSON, and XML files using SQL via a web UI or CLI. See cmd/query_files/README.md for full documentation.
Build: go build -o query_files ./cmd/query_files
Web mode: ./query_files -web -port 8080 -datadir ./data
CLI mode: ./query_files -query "SELECT * FROM users" users.csv
query_files_wasm
WebAssembly build of the query_files tool for use directly in the browser. Exposes importFile, executeQuery, listTables, and exportResults JavaScript functions.
Build: cd cmd/query_files_wasm && ./build.sh --build-only
Build & serve: cd cmd/query_files_wasm && ./build.sh --serve
Open index.html in a browser (requires a local HTTP server due to WASM MIME type).
catalog_demo
Demonstrates the tinySQL catalog and job scheduler APIs by registering tables and scheduling SQL jobs.
Build: go build ./cmd/catalog_demo
Run: ./catalog_demo
debug
Minimal program that exercises BOOL column handling via the raw tinySQL API. Intended as a development/debugging aid, not an end-user tool.
Build: go build ./cmd/debug
Run: ./debug
server/loadtest
Lightweight HTTP load generator for cmd/server.
Build: go build -o bin/tinysql-loadtest ./cmd/server/loadtest