Quick overview of how to install GitHub and then interact with it directly through the SQL Navigator tool via the Team Coding feature.
So let’s get started! Following is a list of all of the tools that you may need to Download and Install to complete configuration of SQL Navigator Team Coding with Version Control provided by Git/GitHub
- Install GitHub Desktop (Its Git but for the server). You might have to create an account, go for it, it’s ok, try something new!
- Download and install GitHub command line client (be sure to select the ‘Windows command line’ option)
- Install SQL Navigator
With those apps downloaded and ready to install, here’s a summary of what we’re going to do:
- Install and configure GitHub command line
- Install and configure GitHub Desktop
- Install SQL Navigator
- Configure SQL Navigator Team Coding to connect to GitHub Repository
- Configure SQL Navigator Team Coding to ignore certain objects by type and name
- Check out a schema object, alter it, check that change back into version control and observe updates
…and here are the detailed steps…
Install GitHub Command Line and be sure to choose the following two non default options when given the chance (all other pages choose the defaults):
Launch GitHub Desktop and create a repository, I’ll call mine ‘SQLNavRepo’ (the local path is up to you, I just used the default because I don’t like to make things more complicated than they need to be)
With repository ‘SQLNavRepo’ selected in the left-hand side, create a new Branch (this is your own private sandbox version of the repository where you can make mistakes and experiment before committing changes from your branch into the main branch)
In SQL Navigator – Connect to the repo you just created
In SQL Navigator, select Team Coding | Administer | Team Projects | Right Click | Create a new Team Project…
Name the project then click the ellipsis (…) then ‘New…’
Name the project then OK
Select the newly created project and then click OK
Now specify the objects to be controlled. Here we can either choose by object type (Tables, Views, Procs) or by wildcard text name filter which objects to place under control of the new project.
Click the ‘New’ icon…
Choose the schema you want to manage and click OK
By default all schema objects regardless of name are to be added to the Team Project. You can uncheck schema objects or click the ellipse (…) to filter by regex terms.
All Done, click OK to continue:
Depending on the number of DB Objects you’ve chosen to manage via Team Coding, you may need to wait a tic or two for the creation of the project to complete, but when you’re done just click OK to dismiss the previous dialog, then from the SQL Nav menu, select Team Coding | Team Coding Manager to confirm that the expected objects were added to your new team project (The big green checkmark tells me everything worked):
Now, we can finally start using Team Coding. If you are developer, the first thing you’ll want to do is check out some procedural code and start working. So it’s simple, just Right click controlled objects to Check-out (or later Check-in, Get latest version, Compare contents, etc.)
Now I’m asked to log into my Git account – do that and click OK
Now add a comment (optional), confirm objects to be checked out, and then click OK…
Visual cue in SQL Navigator that the procedure is now checked out:
Launch Github, I can see the same information…stored proc HR.ADD_JOB_HISTORY is checked out:
Now open the stored proc in SQL Nav editor and make some changes, then save
Satisfied with the changes (maybe do some unit testing, code quality checks), return to the Team Coding Manager, right click and select Compare contents.
Confirm that your local file is different than the Version controlled one…
And if you’re like me, sometimes I’d like to double check by making sure that GitHub sees the same change…it does…
Finally, back to the SQL Navigator Team Coding manager to check the new change in. Just right click on the stored proc and choose ‘Check in’
Add your comment and click OK
And that’s all there is to it. To learn more check out the SQL Navigator user community.