Documentation
¶
Overview ¶
Package main provides a practical SQL playground for tinySQL.
It seeds sample tables (users, orders, sales, articles, docs) and then lets you:
- run any SQL script file via -script
- drop into an interactive REPL via -interactive
- time every statement via -timer
- export query results in multiple formats via -output
- import CSV/JSON files via .import command in REPL
The built-in feature tour (run with no -script/-interactive flag) covers PIVOT, window functions (RANK/DENSE_RANK/PERCENT_RANK/CUME_DIST/NTILE), FULL OUTER / CROSS JOIN, whole-row full-text search (FTS_SEARCH and ROW_TO_TEXT), vector search with VEC_WARM index warm-up, and the SQL:2008 OFFSET ... FETCH syntax, alongside traditional JOIN/GROUP BY/aggregate queries. It also shows a row trigger that writes an audit log whenever a new order is inserted.
Usage:
demo [OPTIONS] -dsn string Storage DSN (default: in-memory) -seed Populate sample tables (default: true) -script FILE Execute SQL statements from FILE -interactive Start interactive SQL shell after setup -timer Print execution time for every statement -quiet Suppress DDL/DML output; show only query results -output FORMAT Output format: table, csv, json (default: table)
Click to show internal directories.
Click to hide internal directories.