You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ MySQL pipe
8
8
9
9
## What does it do?
10
10
11
-
-`sql` allows you to pipe STDIN (hopefully containing SQL) to one or more pre-configured MySQL databases
11
+
-`sql` allows you to pipe STDIN (hopefully containing SQL) to one or more pre-configured MySQL or PostgreSQL databases
12
12
- output comes out in `\t`-separated format, allowing further piping (e.g. works really well with [chart](https://github.com/MarianoGappa/chart))
13
13
- when more than one database is queried, the requests are made in parallel
14
-
-`sql` can either run `mysql` locally, run `mysql` locally but connecting to a remote host (by configuring a `dbServer`), or `ssh` to a remote host and from there run `mysql` to either a local or remote host (by configuring an `appServer` and a `dbServer`)
14
+
-`sql` can either run `mysql/psql` locally, run `mysql/psql` locally but connecting to a remote host (by configuring a `dbServer`), or `ssh` to a remote host and from there run `mysql/psql` to either a local or remote host (by configuring an `appServer` and a `dbServer`)
15
15
16
16
## Installation
17
17
@@ -37,6 +37,8 @@ $ compinit
37
37
38
38
Create a `.databases.json` dotfile in your home folder or in any [XDG-compliant](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) directory. [This](.databases.json.example) is an example file.
39
39
40
+
`sql` decides to execute with MySQL or PostgreSQL depending on the `sqlType` property set for a database, *defaulting to to MySQL if not set.*
41
+
40
42
## Example usages
41
43
42
44
```
@@ -50,8 +52,9 @@ sql all "SELECT * FROM users WHERE name = 'John'"
50
52
## Notes
51
53
52
54
- when more than one database is queried, the resulting rows are prefixed with the database identifier
53
-
- the `all` special keyword means "sql to all configured databases"
55
+
- the `all` special keyword means "sql to all configured databases".
54
56
-`sql` assumes that you have correctly configured SSH keys on all servers you `ssh` to
57
+
-`sql` will error if all targeted databases do not have the same sql type.
55
58
56
59
## Beware!
57
60
@@ -61,7 +64,7 @@ sql all "SELECT * FROM users WHERE name = 'John'"
0 commit comments