Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Support for multiple-schemas #48

Merged
merged 12 commits into from
Oct 31, 2017
Merged

Support for multiple-schemas #48

merged 12 commits into from
Oct 31, 2017

Conversation

shlomi-noach
Copy link
Contributor

@shlomi-noach shlomi-noach commented Oct 24, 2017

Based on #45 by @AnshumanTripathi, and with much gratitude, this PR introduces multi-schema support.

It is now possible to query multiple schemas per host.

To maintain backwards compatibility a new flag is added:

  -s string
      List of databases to query from; overrides -d, prints schema name to output
  • When -s is provided, there is no need for -d.
  • When -s is provided, the schema name is listed as 2nd column in output

Example:

$ echo $hosts | ccql -t 0.5 -s test -q "select uuid() from dual" | column -t
host3:3306    test  d0d95311-b8ad-11e7-81e7-008cfa542442
host2:3306    test  d0d95fd6-b8ad-11e7-9a23-008cfa544064
host1:3306    test  d0d96924-b8ad-11e7-9bde-008cfa5440e4
host4:3306    test  d0d99a9d-b8ad-11e7-a680-008cfa542c9e
$ echo $hosts | ccql -t 0.5 -s test,meta -q "select uuid() from dual" | column -t
host3:3306    test  d0d95311-b8ad-11e7-81e7-008cfa542442
host2:3306    meta  d0d95311-b8ad-11e7-a16c-a0369fb3dc94
host2:3306    test  d0d95fd6-b8ad-11e7-9a23-008cfa544064
host1:3306    meta  d0d95311-b8ad-11e7-9a15-a0369fb5fdd0
host3:3306    meta  d0d95311-b8ad-11e7-bd26-a0369fb5f3d8
host4:3306    meta  d0d95311-b8ad-11e7-a16c-a0369fb3dc94
host1:3306    test  d0d96924-b8ad-11e7-9bde-008cfa5440e4
host4:3306    test  d0d99a9d-b8ad-11e7-a680-008cfa542c9e

@shlomi-noach shlomi-noach deployed to production/github-mysqlutil-ee465bb October 24, 2017 11:29 Active
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil-ee465bb October 24, 2017 11:31 Active
@shlomi-noach shlomi-noach deployed to production/github-mysqlutil-ee465bb October 24, 2017 11:35 Active
@shlomi-noach
Copy link
Contributor Author

@AnshumanTripathi makes sense?

@AnshumanTripathi
Copy link

👍

@shlomi-noach shlomi-noach merged commit 0d38dff into master Oct 31, 2017
@shlomi-noach shlomi-noach deleted the multi-schema-query branch October 31, 2017 05:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants