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)