SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 7.1.166 Pro] - Repository Browser

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 7.1.166 Pro] - Repository Browser
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post [SA 7.1.166 Pro] - Repository Browser Reply with quote
Is there a way to change db connection in Repository Browser so that one could deploy the changes stored in the workspace/repository to several databases?

EDIT: by the way, I'm still not very familiar with the Repository browser. Double clicking a file in the right-tree opens a file (named using the object name) in the editor. Editing and saving that file saves it in the workspace (I suppose, for I doubt it would write directly into the repository). But even though the file is marked as modified (a small red/orange square overlay on the object type icon) and comparing workspace to repository (either by using the context menu or the top row icons) notifies me that it has been changed, neither the top row icons nor the context menu has the "Commit changes to Repository..." (or the "Get Latest from Repository...") item enabled. Both are disabled. On the other hand, accessing the same object through the Database Explorer yields both items enabled.
Wed Oct 22, 2014 9:40 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Quote:
Is there a way to change db connection in Repository Browser so that one could deploy the changes stored in the workspace/repository to several databases?


Yes, of course. Connect to database server you want to update from the repository, from that connection context open the Repository Browser and update the server from repository, you can choose the entire server, or specific databases, or specific objects. To do the same for a different server, close the browser and change your database connection context. Repeat the same operations.


All database and repository updates are 2 step operations as in most other development environments. You work with the code that is saved to your local workspace, in other words, you work with your local copies. So do other team members, they also work with their local copies. To apply changes to database or repository, you need to use the Commit Changes command.

Quote:
Double clicking a file in the right-tree opens a file (named using the object name) in the editor. Editing and saving that file saves it in the workspace (I suppose, for I doubt it would write directly into the repository).

That's correct. if you already have it in the workspace , double clicking opens it from the workspace, otherwise it get's the latest from the repository, saves it to workspace, and then opens it in the editor.
Wed Oct 22, 2014 11:49 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post Reply with quote
I'm familiar with the concept of repositories. It's the Repository Browser in SA that I find a bit hard to deal with. I must have missed something last time I tried. "Commit changes to Repository..." was disabled therefore I was unable to commit changes to repository from the Repository Browser, I had to fall back using TortoiseSVN to do that (though later I noticed that I could do it from Database Explorer). The left pane has the caption DB Connection but I cannot identify the connection itself (there's only a single ('noSrv') there). And the right pane is referred to as the Repository, however it shows the contents of the workspace.

Regarding comparison this was what I did (or at least tried to achieve):

I compared a table to the workspace. So far it went all good, the file for table create script got saved in the workspace. I modified the table in a modeler application and applied the modifications to the database. Recomparing notified me that there were changes in the database and the file in the workspace got updated. And after this point not everything was going the way I assumed it would. I connected to another server. After reopening the Repository Browser I expected there would be some notifications about mismatch between "database - workspace - repository" but nothing happened. Clicking the object opened the file that already contained the modification but no warning whether there were changes waiting or not. Recomparing the database to the workspace also told me there's nothing to do, hence I thought the Repository Browser was still connected to the server where the changes were already applied and not to the most recent one.

I might missed some steps or messed something up, unfortunately I cannot try reproducing the steps until next week. Still, having some features disabled in Repository Browser and enabled in Database Explorer is very confusing. I'd rather use Repository Browser, it's filtering is much faster than the on in Database Explorer. Also, not being able to commit the changes to the repository from the Repository Browser is pretty weird.


Last edited by gemisigo on Thu Oct 23, 2014 4:00 pm; edited 1 time in total
Thu Oct 23, 2014 10:48 am View user's profile Send private message
Mindflux



Joined: 25 May 2013
Posts: 616
Country: United States

Post Reply with quote
gemisigo wrote:
I'm familiar with the concept of repositories. It's the Repository Browser in SA that I find a bit hard to deal with. I must have missed something last time I tried. "Commit changes to Repository..." was disabled therefore I was unable to commit changes to repository from the Repository Browser, I had to fall back using TortoiseSVN to do that (though later I noticed that I could do it from Database Explorer). The left pane has the caption DB Connection I cannot identify the connection itself (there's only a single ('noSrv') there). And pane is referred to as the Repository, however it shows the contents of the workspace.



I've had this problem too and I find getting out of the repository browser and selecting commit changes in SSMS right click context from the database/object explorer works. I am not sure why at times the repository browser won't let you commit anything even though several files are marked as changed (colored red I believe?)....

odd
Thu Oct 23, 2014 11:44 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Thank you all for your feedback. I have submitted a new ticket to investigate and fix this issue. Tracking number #SA0025077.
Thu Oct 23, 2014 11:53 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post Reply with quote
Trying "Commit Changes to Database..." item from context menu in Database Explorer opens the "Commit Changes to Repository" dialog instead of committing the changes to the database. Also, clicking the Show Differences button for a stored procedure (called usp_kosar_ismetles.sql) yields an error message:
Quote:

Workspace copy of the file 'database\Procedures\volan.usp_kosar_ismetles.sql' not found

although the file is in the workspace.

EDIT: double-clicking a file in the right-tab un-applies the filter.
Mon Oct 27, 2014 6:16 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Quote:
Trying "Commit Changes to Database..." item from context menu in Database Explorer opens the "Commit Changes to Repository" dialog instead of committing the changes to the database.

It internally needs the repository connection to validate file versions, that's why you see that connection prompt.

Quote:
Workspace copy of the file 'database\Procedures\volan.usp_kosar_ismetles.sql' not found

Do the file exists in the specified location [workspace root folder]\database\Procedures\volan.usp_kosar_ismetles.sql?


Quote:
double-clicking a file in the right-tab un-applies the filter.

Filter for the database server?
Tue Oct 28, 2014 9:16 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post Reply with quote
SysOp wrote:
It internally needs the repository connection to validate file versions, that's why you see that connection prompt.

Yes, I thought it should go that way, and immediately after that I thought if it is going to commit the changes to the database after committing them to the repository then it is doing it in wrong order (it might fail because syntax errors and then I'm going to have a worthless revision added to the repo). But after sending the file to the repository nothing happened. The changes didn't make to the database at all. Also, I wanted to commit the changes to the Database and not to the Repository. Usually several versions make it to the Database until I'm satisfied with the results and decide to store the last one in the Repository. I don't want those to be stored.

SysOp wrote:

Do the file exists in the specified location [workspace root folder]\database\Procedures\volan.usp_kosar_ismetles.sql?

Exactly. The last time I tried the error message was slightly different
Quote:
File cannot be found in the workspace (try to get latest version).
but the file was there in both cases.

I've got an object (a stored procedure in schema volan, called usp_kosar_ismetles). There's a version of it on the database server, a modified file in the workspace and an earlier version of it in the repository. Here are the situations I tried:

Using Repository Browser, top row or context menu:
#1. Compare Database to Workspace (left pane,). Comparison indicated there were differences, Show Differences button worked properly.
#2. Compare Database to Repository (right pane). Comparison indicated the file was modified in the workspace. Show Differences button yielded error message:
Quote:

svn: E200009: Destination file 'R:\Temp\Gem\scs_sa\sa.tmp_volan.usp_kosar_ismetles' exists, and will not be overwritten unless forced

I guess it had to do something with svn temporary files but I've found no way to force it. After deleting the file from that folder the button worked properly. Until the next run.
#3.Compare Repository to Workspace. Comparison indicated there was difference. Show Differences button yielded error message:
Quote:

File cannot be found in the workspace (try to get latest version).

although the file was there in the workspace. Also, the "Get Latest from Repository..." and the "Commit Changes to Repository..." context menu items (or top row) are disabled.

Using Database Explorer:
When trying on a single object (usp_kosar_ismetles), neither "Compare Database to Repository..." nor "Compare Database to Workspace..." context menu items produced any visible results.
Trying the same context menu items on Procedures category rather than on the individual object resulted in several objects with different statuses (modified in workspace or database only). usp_kosar_ismetles was marked as modified in workspace and the Show Differences button worked properly.

Trying the "Get Latest from Repository..." on the object said "Get latest complete for: volan.usp_kosar_ismetles" but made no changes to the file in the workspace until I manually removed the file after which it was replaced with the version in the Repository. Modifying the file resulted in case #3 above.


Suggestion: it would be nice if double-clicking a file/object in the comparison result set could show the difference. It's much more convenient comparing way than to click the file and then click the Show Differences button.

SysOp wrote:

Filter for the database server?

No, the filter for repository/workspace file. After double-clicking the file is opened in SQL Editor and as soon as it's finished, the filter is un-applied. It remains in the editbox but the result set in the tree below isn't filtered anymore. Check the video here.
Tue Oct 28, 2014 10:22 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Thank you. I'm going to log the filter issue, suggested enhancement for the double click behavior, and also ask to look into the commit issue. I believe you're using Subversion, right
Tue Oct 28, 2014 10:45 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post Reply with quote
Thank you very much.

Yes, I'm using Subversion.

EDIT: The Commit Changes to Database comes with modified items checked (except for deleted ones, but I guess that's a protection against accidental removal). Clicking the Select/Deselect All will first select them all (checked) and then unselect them all (unchecked). Clicking the Show System Objects checkbox results in restoring the states of the checkboxes to the initial one. Check video here.
Tue Oct 28, 2014 10:46 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1396

Post Feature request Reply with quote
I'd be nice to have predefined filters that can be combined and are based on file/object states (up-to-date to Database, up-to-date to Repository, modified in Database, modified in Workspace, deleted in Database/Workspace/Repository, etc.).
Tue Nov 04, 2014 10:15 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6500

Post Reply with quote
Thank you. I think this is really a great idea.
Tue Nov 04, 2014 10:18 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.