mdq queries multiple databases in parallel and output the results in JSON.
Go
Latest commit 6b5d807 Feb 14, 2017 @morikuni committed on GitHub Merge pull request #7 from morikuni/first-arg-as-tag
Handle First argument as a tag option

README.md

mdq

Build Status

mdq queries multiple databases in parallel and output the results in JSON.

Example

$ mysql -u root --database example -e "select * from hello";

+------+---------+
| id   | message |
+------+---------+
|    1 | hello   |
|    2 | world   |
+------+---------+


$ cat ~/.config/mdq/config.yaml
dbs:
  - name: "example_db"
    driver: "mysql"
    dsn: "root@/example"
    tags: ["example_tag"]


$ mdq --tag example_tag "select * from hello" | jq .
[
  {
    "Database": "example_db",
    "Columns": [
      "id",
      "message"
    ],
    "Rows": [
      {
        "id": "1",
        "message": "hello"
      },
      {
        "id": "2",
        "message": "world"
      }
    ]
  }
]

Supported Databases and DSN