Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olbrichattila/gocsvexporter
Export any table from your database to CSV, Supports sqLite, MySql, PostgresQl, FirebirdSQL
https://github.com/olbrichattila/gocsvexporter
csv-export firebirdsql golang golang-cli mysql postgresql sqlite
Last synced: about 1 month ago
JSON representation
Export any table from your database to CSV, Supports sqLite, MySql, PostgresQl, FirebirdSQL
- Host: GitHub
- URL: https://github.com/olbrichattila/gocsvexporter
- Owner: olbrichattila
- Created: 2024-06-26T20:25:21.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-07-14T19:14:17.000Z (6 months ago)
- Last Synced: 2024-07-15T20:34:21.468Z (6 months ago)
- Topics: csv-export, firebirdsql, golang, golang-cli, mysql, postgresql, sqlite
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Export table from database to a csv file
This little utility exports database table from a database to a CSV file
## Install:
```
go install github.com/olbrichattila/gocsvexporter/cmd/csvexporter@latest
```Usage: ```csvexporter . ```
where the Separator is optional, if not set then it defaults to ```,```
The database connection can be set by .env.csvexporter file, or if not exists, the application tries to get it from linux environment variables what you can set:
Example:```
export DB_CONNECTION=sqlite
export DB_DATABASE=./data/database.sqlite```
Possible .env.csvexporter settings (please see .env.* examples as well)
### SqLite:
```
DB_CONNECTION=sqlite
DB_DATABASE=./data/database.sqlite
```### MySql:
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=migrator
DB_USERNAME=migrator
DB_PASSWORD=H8E7kU8Y
```### PostgresQl:
```
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_SSLMODE=disable
```### FirebirdSQL
```
DB_CONNECTION=firebird
DB_HOST=127.0.0.1
DB_PORT=3050
DB_DATABASE=/firebird/data/employee.fdb
DB_USERNAME=SYSDBA
DB_PASSWORD=masterkey
```### Makefile targets:
- run
- switch-sqlite
- switch-mysql
- switch-pgsql
- switch-firebird
- lint
- test (under development)### Coming Next
- test
- distributed import