LQS
lqs is a small Go CLI for testing and debugging SQL commands with embedded metadata and, optionally, Lua scripts.
The idea came from a concrete annoyance: every time I wanted to validate a query in PostgreSQL or SQLite, I’d open psql or sqlite3, copy, paste, test, tweak, copy again. With parameterized queries it got worse, because each client handles $1, ?, and :name differently.
The fix was to treat the .sql file as a small executable script. At the top of the file you put metadata in comments:
#!./lqs
-- DB: sqlite://:memory:
-- JSON: TRUE
SELECT sqlite_version();
-- DB: sets the connection. -- JSON: TRUE prints the result as JSON. -- LUA: lets a Lua script produce placeholder values. -- SQL: lets another query feed those placeholders. Combining the three, you can test parameterized queries without ever leaving the file.
CGo-free. Uses only the standard library and pure Go drivers. Compiles on any supported platform.
There’s also a Neovim integration that takes a visual selection, writes it to a temp file, runs lqs, and shows the output. I use it a lot.
Project articles
| Name | Last modified | Size | Description |
|---|---|---|---|
| lqs-uma-ferramenta-prtica-para-testar-sql.md | 2026-08-28 14:05 | 3.1K | LQS: a practical tool for testing and debugging SQL. It allows integrating metadata, Lua scripts, and auxiliary queries to optimize your workflow and detect errors early. |