SQLite 3 · Import, export and backup
Export a query to CSV
Write query results to a CSV file with headers.
sqlite3 -csv -header app.db "SELECT * FROM users;" > users.csv
Official SQLite 3 documentation
More import, export and backup commands
- Import a CSV file
- Dump the database as SQL
- Restore from a SQL dump
- Make a binary backup
- Run a SQL script
All import, export and backup commands · SQLite 3 cheatsheet