DEV Community

vahid Saber
vahid Saber

Posted on

Introducing sqlxport: Export SQL Query Results to Parquet or CSV and Upload to S3 or MinIO

In today’s data pipelines, exporting data from SQL databases into flexible and efficient formats like Parquet or CSV is a frequent need β€” especially when integrating with tools like AWS Athena, Pandas, Spark, or Delta Lake.

That’s where sqlxport comes in.

πŸš€ What is sqlxport?
sqlxport is a simple, powerful CLI tool that lets you:

Run a SQL query against PostgreSQL or Redshift
Export the results as Parquet or CSV
Optionally upload the result to S3 or MinIO
It’s open source, Python-based, and available on PyPI.

πŸ› οΈ Use Cases
Export Redshift query results to S3 in a single command
Prepare Parquet files for data science in DuckDB or Pandas
Integrate your SQL results into Spark Delta Lake pipelines
Automate backups or snapshots from your production databases
✨ Key Features
βœ… PostgreSQL and Redshift support
βœ… Parquet and CSV output
βœ… Supports partitioning
βœ… MinIO and AWS S3 support
βœ… CLI-friendly and scriptable
βœ… MIT licensed
πŸ“¦ Quickstart
pip install sqlxport
sqlxport run \
--db-url postgresql://user:pass@host:5432/dbname \
--query "SELECT * FROM sales" \
--format parquet \
--output-file sales.parquet
Want to upload it to MinIO or S3?

sqlxport run \
... \
--upload-s3 \
--s3-bucket my-bucket \
--s3-key sales.parquet \
--aws-access-key-id XXX \
--aws-secret-access-key YYY
πŸ§ͺ Live Demo
We provide a full end-to-end demo using:

PostgreSQL
MinIO (S3-compatible)
Apache Spark with Delta Lake
DuckDB for preview
πŸ‘‰ See it on GitHub

🌐 Where to Find It
πŸ“¦ PyPI: sqlxport
πŸ’» GitHub: sqlxport
🐦 Follow updates on Twitter/X
πŸ™Œ Contributions Welcome
We’re just getting started. Feel free to open issues, submit PRs, or suggest ideas for future features and integrations.

Top comments (0)