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
Navigating Google Cloud Console's SQL list can be annoyingly slow once your instances grow beyond a certain size. Avoid the pain with this Alfred workflow that grabs and caches all your SQL instance names for a given project and lets you search them easily. Once you find the instance you're looking for just press `enter` and your browser will open with the dashboard for that instance. Easy!
3
3
4
4
## Included
5
-
- A simple go client to connect to the SQL API and list instances. Just run `./build` in the `go` directory of the workflow.
5
+
- A simple go client to connect to the SQL API and list instances. Just run `./build` in the `go` directory of the workflow and add the resulting `cloudsql` binary to `CLOUD_SQL_PATH` in the workflow environment variables (see pic below). Built with Go 1.9.2
6
6
7
7
## Requirements
8
8
- Alfred 3
9
+
- Go 1.9.2
9
10
10
11
## Usage
11
12
12
13
`csql [QUERY]`
13
14
14
15
Press enter to open the CloudSQL instance in your browser
15
-

16
+

16
17
17
18
`csql-refresh`
18
19
@@ -24,21 +25,20 @@ press enter to update the cache of CloudSQL instances (default TTL = 300 seconds
24
25
**1. Install the workflow**
25
26
26
27
You can download the workflow from the [releases page](#)
27
-
This workflow requires Alfred 3.
28
+
You will need to run `./build` in the `./go` directory of the workflow in order to install the client that fetches the list of your DB instances. Please note that this workflow requires Alfred 3.
28
29
29
30
**2. Environment variables**
30
31
- Set `CLOUD_SQL_PATH` to the location of the `cloudsql` binary (source included in `go` folder)
31
-
- Set `PROJECT` to the name of the Google project you want to search. This workflow uses the `golang.org/x/oauth2/google` library and loads your system's default auth, so make sure it accords with the `PROJECT` variable.
32
+
- Set `PROJECT` to the name of the Google project you want to search.
This implementation relies on the calling program (pointed to by `CLOUD_SQL_PATH`) to properly set up the client. Check the Google docs if you require more information on authenticating.
38
-
39
-
**4. Ruby Dependencies**
40
+
This workflow uses your default gcloud credentials (usually set via `gcloud auth application-default login`). Make sure your current identity has access to the target project.
40
41
41
-
This workflow is built and tested with Ruby 2.3.3. You will also need the `google-api-client` gem installed on your system. Run `gem install google-api-client` to install the necessary gem.
0 commit comments