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.
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 & run demo: cd cmd/wasm_node && ./build.sh
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
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
Notes:
The in-memory DSN is mem://?tenant=default. Files can be persisted using file:/path/to/db.dat?tenant=<name>&autosave=1.
The server, REPL, and tinysql CLI all rely on the internal driver registration (_ ".../internal/driver").