Summary
Goliath integrates with GitHub to allow users the ability to collaborate through use of version control. Users can pull the latest version of a workspace then update and save changes. Users who are working on a file will be notified when that file has changed in GitHub.
Connect Goliath to GitHub
A prerequisite for using GitHub with Goliath is that you need to have an existing GitHub account. Visit GitHub to sign up if you do not currently have one.
In Goliath, you can connect to GitHub via GitHub Options.
- From the Top Navigation Menu click Query
- Select GitHub Options
- Click Login with GitHub in the options panel
- Select GitHub Scope (public/all repositories) and click OK
- Authorize Goliath Integration with GitHub
- Confirm access
After connecting GitHub to Goliath, the Login with GitHub option will be replaced with GitHub Enterprise/GitHub and the name of the user logged in. If the access token remains active the user will stay connected to GitHub.
Log out of GitHub
To log out of GitHub and revoke access
- From the Top Navigation Menu click Query
- Select either Load or Save
- In Destination, click GitHub/GitHub Enterprise
- Click on the logout icon found left of the logged in username
- Confirm you wish to logout
- In the GitHub popup window, click Revoke access
- Confirm revoke access
- Close the GitHub popup window
GitHub Options
The GitHub commit location (repository, branch, filename, and commit message) can be set in GitHub Options per tab. This information is used each time a user commits on run or demand.
GitHub Options can be found in the top nav menu under Query.
In addition to setting the GitHub location, GitHub Options can also set what is saved in the workspace. The file can include options and/or parameters when saving the workspace.
Auto Commit on Run allows the user to automatically use the values set in GitHub Options to commit the file to GitHub on each successful run.
Add GitHub repository, branch, filename, and message to set the default values when committing to GitHub. Set the other options as you would when saving a workspace.
Run Options
To support committing to GitHub, additional options are available in the Run button.
The Run button provides the ability to run the query, run the query and commit, and commit the workspace.
Commit options become available when GitHub Options are set. A notice displaying the GitHub path will identify that the values are set.
Run invokes running the query. If, in GitHub Options, Auto Commit on Run is checked then on a successful run the workspace will also be saved to GitHub.
Run and Commit provides a method to commit the workspace on a successful run. This is a convenient method to commit when the Auto Commit on Run is not checked.
Commit will not run the query but instead directly commit the workspace to GitHub. This option is a quick way to commit the workspace without having to access Save Workspace.
Save to GitHub
You can save queries, scripts, and workspaces to GitHub.
If, in a single tab, you are saving a query with no options and parameters the file will be saved with .sql and contain only the query content.
If, in a single tab, you are saving a script in go mode with no options and parameters the file will be saved with .go and contain only the script content.
If you include options, parameters, and/or all tabs the file will be formatted and saved as a .json file that contains the query/script and included selections (options, parameters, all tabs).
To Save a Query/Script/Workspace
- From the Top Navigation Menu click Query
- Select Save
- In Destination, click GitHub/GitHub Enterprise
- Specify the Repository to save to by either
- typing the repository name or
- clicking on the button to display a list of repositories to choose from
- Specify the Branch to save to by either
- typing the branch name or
- clicking on the button to display a list of branches to choose from
- Specify the Filename
- You can enter a new or existing filename or
- click on the button to display a list of existing files to choose from
- Enter a Commit Message
- Optional
- Select Include Options to save query options along with query.
- Select Include Parameters to save parameters. Parameters are global and if included will be saved regardless of whether the current tab uses them or not.
- Select Include All Tabs to save multiple tabs in a single file. Left unchecked only the current, active tab will be saved.
- Click Save
Load from GitHub
Queries, scripts, and workspaces can be pulled from GitHub.
SQL queries containing only the query text and with a file extension of .sql can be loaded to Goliath.
Scripts containing only golang text and with the file extension of .go can be loaded to Goliath.
Workspace files contain query or script text along with either query options, parameters, and/or multiple tabs. They are in a specific JSON format. If editing or loading a workspace file that was created outside of Goliath, please refer to a previously saved workspace file for the proper JSON formatting.
To Load a Query/Script/Workspace
- From the Top Navigation Menu click Query
- Select Load
- In Destination, click GitHub/GitHub Enterprise
- Specify the Repository to load from by either
- typing the repository name or
- clicking on the button to display a list of repositories to choose from
- Specify the Branch to load from by either
- typing the branch name or
- clicking on the button to display a list of branches to choose from
- Specify the Filename to load by either
- Typing the filename or
- clicking on the button to display a list of files to choose from
- Click Load.