sqlite3 app.db '.mode column' '.headers on' 'SELECT * FROM users;'

Category: Databases & SQL

sqlite3 app.db '.mode column' '.headers on' 'SELECT * FROM users;'

Format query output as aligned columns

.mode column aligns values into columns and .headers on prints the column names; both are dot-commands that configure the session. Other modes include csv, json, and markdown. Related: .nullvalue.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.