Working with Toad Edge you can store versions of your database objects in a file system repository. This gives you a way to reference and compare database objects without having to use a Version Control System (VCS). You can always add these objects to a VCS in the future if you need to.
To start the process in Toad Edge, choose a database you want to version:

one.JPG-1100x19998

In this case I am going to use the Sakila database.  Right-click on the database and then choose Repository. 

If this is the first time you have mapped this database you will only see the ‘Map Database’ option available to you.

Click on that menu item.

A window will open that asks for a path to the file system folder you wish to use.  You can use anything, and it can be local or on the network.  Using a network location will make it easier to share this repository with other members of your team.  I will cover this later.

In my case, I am just using my C: drive and I gave the repository the name sakila1. Again, you can use any naming convention you wish.  Once you have provided the path, click OK.

two-a.JPG-640x480

Once you click OK the progress bar window shown below will open.  If you have a large database you may want to run this process in the background.

three.JPG-1100x19998

When the repository is built the window above will close and you will see a comparison of what is in the database and what is in the repository. 

Now, you will notice that the repository doesn’t show anything on the right-side window.  

What’s up with that?

new-sakila1.JPG-1000x1000

What has happened so far is that we have told Toad Edge that we want to track changes to these objects and we have ‘cataloged’ them, but we have not synchronized the database with the repository yet.

So what do we do? We synchronize the two.

six.JPG-1100x19998

From the comparison window simply click on the dropdown arrow next to the file folder icon and choose ‘Update Objects in Repository’.

You will be prompted with a confirmation window:

sync-confirmation.JPG-640x480

Click OK to continue.

You will then see that the comparison window has been updated to show the repository on the right side. Now, you may be wondering why you don’t actually see any objects in either window now.  That is because before you ran the sync there were differences between the database and the repository (the repository was empty).  Now that they have been synched there are no differences.  As you work on the objects in the database the changes will be reflected in the comparison window.

Since we have synched the database to the file system repository you can now go to the file folder and see the objects. 

path.JPG-1100x1200

Each object type has it own folder. When you expand a folder you can see the objects therein:

expanded-sakila1-tree.JPG-1000x1000

You can see that there are 16 tables in the TABLE folder. These are saved as JSON files so you can access them as needed. 

Here you can see the file structure of the actor.json file, opened in Toad Edge:

actor-json.JPG-1100x1200

Now let’s make a change to a table. 

In the screen shot below you can see that I added a column to the actor table.  I just called it ‘five’. 

On the left side you will see that the actor table now has a red key icon highlight.  This indicates that there has been a change made to the table (or whatever object you may be working on). You will also see [Found Changes in DB…] next to the table name.

table-change.JPG-1100x1200

Now we need to resynch the database and the repository. Right-click on the database and choose Repository then choose Synchronize.  This will compare the two environments.

resynch1.JPG-1000x1000

Now you see that the Actor table has been flagged as being different between the database and the repository and you can see the differences in the comparison screen.

resynch2.JPG-1000x1000

Now we can resynch the two environments by choosing “Update Objects in Repository”:

resynch3.JPG-640x480

Once the sync is done the comparison window will refresh and show nothing is out of sync and the database and repository are the same.

resynch4.JPG-1000x1000

In conclusion, Toad Edge makes it easy to work on your database and store your changes in in a repository, which can also be shared with other team members so everyone can stay in sync.

There is also a video available here on Toad World that shows how you can store these objects in a GIT repository, but the concept is the same for other VCS systems you may be using.

I hope you found this information helpful and stay tuned for more Toad Edge blogs.

About the Author

Mark Kurtz

Mark Kurtz has been with Quest Software since April 2000 and has held the position of Software Sales Engineer in the PreSales Organization since then. Mark started his career as a programmer/analyst for NASA supporting the Space Shuttle program. He became a DBA after moving into the health care industry and has managed several teams of DBA's in his career. Outside of work, Mark enjoys spending time with his family, playing poker, and working on old cars and woodworking.

Start the discussion at forums.toadworld.com