SQLite: Query Result Formatting in the CLI
5 days ago
- #CLI
- #OutputFormatting
- #SQLite
- The ".mode" command in SQLite CLI version 3.52.0 has been enhanced for more flexible output formatting.
- New options replace legacy commands like ".width", which is now deprecated.
- Default interactive mode is "qbox" with additional settings like "--quote relaxed" and "--limits 5,300,20".
- New modes include "tty", "batch", and "psql" (mimicking PostgreSQL's psql utility).
- Various formatting options are available, including column width adjustments, text wrapping, and control character handling.
- The ".mode --list" command lists all available output modes.
- Detailed settings can be viewed with ".mode -v".
- Special modes like "insert" generate SQL INSERT statements, and "split" mode optimizes single-column displays.
- Control character display can be customized with "--escape" options.
- Line endings on Windows can be adjusted with the ".crlf" command.