sqlxp is a CLI for exporting sql queries to multiple file formats.
Select users from an sqlite database and write the result as a csv
sqlxp -q 'SELECT * FROM users' -o users.csv example.db
Tip
For larger exports, it's recommended to use CSV or JSON arrays as they write directly to the file, minimizing memory usage.
For more usage information run sqlxp --help
.
- Supports multiple SQL databases (PostgreSQL, MySQL, SQLite)
- Execute raw SQL queries and process results
- Outputs results in json & csv
- Option to print output to the console or write to a file
To install the tool, make sure you have Go installed. Then, clone this repository and run:
git clone https://github.com/skabillium/sqlxp.git
cd sqlxp
go mod tidy
go build -o sqlxp ./cmd # Or make build