Skip to content

a command line to query the database and save the result to csv. Currently only postgres and mysql are supported.

License

Notifications You must be signed in to change notification settings

zhangyuan/sql2csv

Repository files navigation

Usage

You can download the executables from the Releases page.

Example

Run a local posrtgres instance:

docker-compose up

Open a new termial and run:

export DATABASE_URI="postgresql://localhost/postgres?user=postgres&password=mypassword&sslmode=disable"

go run main.go -q "select * from users" | tee output.csv

# or use the executable on MacOS for example

./sql2csv-amd64-darwin -q "select * from users" | tee output.csv

About

a command line to query the database and save the result to csv. Currently only postgres and mysql are supported.

Resources

License

Stars

Watchers

Forks

Packages

No packages published