Skip to content

Commit d238973

Browse files
Merge pull request #2 from inloop/develop
Update readme
2 parents 8c675ad + 8a57ea7 commit d238973

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,44 @@
11
# sql-exporter
2+
3+
[![Build Status](https://travis-ci.org/inloop/sql-exporter.svg?branch=master)](https://travis-ci.org/inloop/sql-exporter)
4+
25
Command line utility to export data from SQL database
6+
7+
# Installation
8+
9+
Basically download binary, make it executable and that's it.
10+
11+
```
12+
# macos example
13+
# releases: https://github.com/inloop/sql-exporter/releases
14+
curl -L https://github.com/inloop/sql-exporter/releases/download/0.1.3/sql-exporter-darwin-amd64 > /usr/local/bin/sql-exporter
15+
chmod +x /usr/local/bin/sql-exporter
16+
```
17+
18+
# Usage
19+
20+
```
21+
sql-exporter dump -u postgres://username:password@hostname/database?sslmode=required -q "SELECT * FROM table" -o output.csv
22+
23+
# more info by running `sql-exporter dump -h`
24+
25+
USAGE:
26+
sql-exporter dump [command options]
27+
28+
OPTIONS:
29+
-u value, --db-url value database connection string ({type}://{username}:{password}@{host}/{db}) [$DATABASE_URL]
30+
-q value, --query value SQL query as source for csv data [$QUERY]
31+
-o value, --output value output file name (if not specified, stdout is used) [$OUTPUT]
32+
```
33+
34+
You can also use pipes by omitting `-o` attribute:
35+
36+
```
37+
sql-exporter dump -u postgres://username:password@hostname/database?sslmode=required -q "SELECT * FROM table" | grep "blah" > output.csv
38+
```
39+
40+
## Docker usage
41+
42+
```
43+
docker run --rm inloopx/sql-exporter sql-exporter dump -u postgres://username:password@hostname/database?sslmode=required -q "SELECT * FROM table" > output.csv
44+
```

0 commit comments

Comments
 (0)