{"id":45703353,"url":"https://github.com/frederikhs/sql2csv-cmd","last_synced_at":"2026-02-24T23:15:00.445Z","repository":{"id":95467606,"uuid":"608208792","full_name":"frederikhs/sql2csv-cmd","owner":"frederikhs","description":"cli application for extracting data as csv from a PostgreSQL database using sql","archived":false,"fork":false,"pushed_at":"2023-03-01T21:56:31.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T03:13:35.104Z","etag":null,"topics":["csv","go","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frederikhs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-01T14:46:09.000Z","updated_at":"2023-03-03T22:58:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7872ca9-0b5d-4f7e-b94c-6e33d84d3d86","html_url":"https://github.com/frederikhs/sql2csv-cmd","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"6163e20e2826cd2788b32eeaa24a238c352473e5"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/frederikhs/sql2csv-cmd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederikhs%2Fsql2csv-cmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederikhs%2Fsql2csv-cmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederikhs%2Fsql2csv-cmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederikhs%2Fsql2csv-cmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frederikhs","download_url":"https://codeload.github.com/frederikhs/sql2csv-cmd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frederikhs%2Fsql2csv-cmd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29804527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T22:43:48.403Z","status":"ssl_error","status_checked_at":"2026-02-24T22:43:18.536Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","go","sql"],"created_at":"2026-02-24T23:14:59.816Z","updated_at":"2026-02-24T23:15:00.441Z","avatar_url":"https://github.com/frederikhs.png","language":"Go","readme":"# sql2csv-cmd\n\n[![GoDoc](https://godoc.org/github.com/frederikhs/sql2csv-cmd?status.svg)](https://godoc.org/github.com/frederikhs/sql2csv-cmd)\n[![Quality](https://goreportcard.com/badge/github.com/frederikhs/sql2csv-cmd)](https://goreportcard.com/report/github.com/frederikhs/sql2csv-cmd)\n[![Test](https://github.com/frederikhs/sql2csv-cmd/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/frederikhs/sql2csv-cmd/actions/workflows/test.yml)\n[![Release](https://img.shields.io/github/v/release/frederikhs/sql2csv-cmd.svg)](https://github.com/frederikhs/sql2csv-cmd/releases/latest)\n[![License](https://img.shields.io/github/license/frederikhs/sql2csv-cmd)](LICENSE)\n\n*cli application for extracting data as csv from a PostgreSQL database using sql*\n\n## Usage\n\n```text\nUsage of sql2csv-cmd:\n  -c string\n    \tconnection string for the database: postgres://user:pass@host:port/dbname\n  -d string\n    \thostname for database as defined in .pgpass\n  -f string\n    \tfile containing query to run eg. query.sql\n  -o string\n    \toutput filename eg. result.csv\n  -q string\n    \tquery to run\n  -t int\n    \tquery timeout in seconds\n  -v\tverbose mode\n```\n\n## Example\n\n```shell\nsql2csv-cmd -d db.example.com -q \"SELECT * FROM public.users\" -o users.csv\n```\n\n```shell\nsql2csv-cmd -d db.example.com -f query.sql -o query.csv\n```\n\n## Installation\n\n### Linux amd64\n\n```bash\n# install\ncurl -L https://github.com/frederikhs/sql2csv-cmd/releases/latest/download/sql2csv-cmd_Linux_x86_64.tar.gz -o sql2csv-cmd.tar.gz\ntar -xvf sql2csv-cmd.tar.gz\nsudo mv sql2csv-cmd /usr/local/bin/sql2csv-cmd\n\n# clean up\nrm sql2csv-cmd.tar.gz\n```\n\n## .pgpass\n\nsql2csv-cmd uses the `.pgpass` file that resides in the `$HOME` directory of the user running the program.\n\n---\n\nExample of a connection configuration in the `.pgpass` file\n\n```\n\u003cHOST\u003e:\u003cPORT\u003e:\u003cDATABASE\u003e:\u003cUSERNAME\u003e:\u003cPASSWORD\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederikhs%2Fsql2csv-cmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrederikhs%2Fsql2csv-cmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrederikhs%2Fsql2csv-cmd/lists"}