SQLite: Query Result Formatting in the CLI

thunderbong 14 points 2 comments March 09, 2026
www.sqlite.org · View on Hacker News

Discussion Highlights (1 comments)

mergisi

The .mode options in SQLite's CLI are surprisingly comprehensive for what most people treat as a lightweight embedded database. Table mode and box mode in particular make ad-hoc queries readable without piping through external tools. One underrated use case: switching between .mode json and .mode csv lets you prototype data pipelines entirely inside the SQLite shell. You can validate query logic, check edge cases in formatting, and export in the right shape without writing a single line of application code. The challenge for newcomers is discoverability. Most people learn about .mode column and .headers on from Stack Overflow answers, then never explore further. Having the full formatting reference documented in one place helps bridge that gap — especially for people coming from tools like ai2sql.io (disclosure: I work on this) where the focus is getting the query right first, and formatting the output is a separate step they often haven't thought about yet.

Semantic search powered by Rivestack pgvector
3,471 stories · 32,344 chunks indexed