How to set git to work as a Shared Database?
pablolerner
Posts: 27 Bronze 1
I am trying to use config files to set git to work with a Shared Database. My intention is to bypass the stage/index thing and force git push after every commit. And then force git pull before every time Source Control compares the database with the git repository. But I don't really understand how to set all of this up. Is there any documentation on how to achieve this?
Tagged:
Best Answers
-
ATurner Posts: 203 Silver 2Hi pablolerner
Our native Git connection does not allow shared DBs.
This is by design as we believe that git should be used with dedicated databases only
-
DanC Posts: 630 Gold 5pablolerner said:ATurner said:[...]you would have to commit with your preferred source control tool separately[...]Hello. I don't know how much others will agree but this is not something that I, as a database developer and user of SQL Source Control, can call "suppor for Git". What you are describing is just support for script files in the file system and then using Git as a completley sepparate tool. What I need, and please I ask the other users in this thread to clarify if they do too, is for SQL Source Control to provide all the functionality within it self, without using external tools.By the way, going back to my original question in this thread, I was never able to make this work for me.
If you're using a Dedicated Database then you will have full support for Git within SQL Source Control, however, if you're working on a Shared Database you cannot link directly to SQL Source Control with Git as this is a limitation due to our native Git connection does not allow for shared dbs.
Therefore, you will need to use the option of linking to a Working Folder or use a custom setup: https://documentation.red-gate.com/soc5/linking-to-source-control/other-source-control-systems/link-to-a-custom-setup
You can then use the command line to perform your commits, push and pulls.
This behavior is unlikely to ever change due to the technical limitations, sorry that's not idealKind regards
Dan Calver | Redgate Software
Have you visited our Help Center?
Answers
I did find a way to link with shared mode but the documentation only shows half of what is it needed to do it. Essentially, all that SQL Source Control does is write scripts for the database objects into text files and then says "OK, use your own tools from here on out." The Git GUI that comes with Git works fine, but, if it is so simple, why is Red Gate ignoring it?
We do support a shared model within SQL source control with source control but as you mention you would have to commit with your preferred source control tool separately. This will allow you to set it up in a shared model and will then give you the ability to push to changes when you need via your source control tool.
Below is the link to our documentation on this method:
https://documentation.red-gate.com/soc/linking-to-source-control/other-source-control-systems/link-to-a-working-folder
Must be a different set of developers working on Red Gate SQL Source Control than on SQL Prompt. Prompt is a wonderful product and life would be must more tedious without it. Don't know what happened to SQL Source Control.
Product Manager
Redgate Software
Flyway Desktop doesn't currently have a community version. Flyway's command line does have a community version. It is implemented in Java, but this is packaged with the command line, so no need for you to install it separately. You also have the option to call the Docker Hub CLI.
The paid editions of Flyway Desktop will provide a SQL Source Control-like GUI experience. ie, maintaining an object-level schema model that can be source controlled. Flyway Community only provides a mechanism to deploy "migration scripts" against a database. It doesn't have a schema model.
Product Manager
Redgate Software