SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[SA 9.0.166 Pro] Use same target for multiple DB types?
Goto page 1, 2  Next
 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[SA 9.0.166 Pro] Use same target for multiple DB types?
Author Message
Mindflux



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

Post [SA 9.0.166 Pro] Use same target for multiple DB types? Reply with quote
Is there a way to use the same target (SQL Editor) for multiple DB types? I know you can connect to whatever type DB but you want but the default assistance/references/snippets/formatting may not be for that type of DB?


Last edited by Mindflux on Thu Oct 20, 2016 3:13 pm; edited 1 time in total
Thu Oct 20, 2016 2:28 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
huh. It does look like it's smart enough to use different target options in different tabs. But I'm unsure if you can set defaults for the non-default DB type.

Well it seems to have changed my defaults from SQL Server to sqlite3 in my testing... that's no good. (maybe from Ctrl-Shift-F5).

It also seems to re-connect to the last connected DB type, rather than the default/autoconnect option for the target when you close all the tabs and hit ctrl-n.
Thu Oct 20, 2016 2:38 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
I requested some years ago a change in behavior to open new connection to the same type and server where the current tab is connected, which is more likely to happen during a workflow, even when connecting to multiple different servers. It worked rather well but now that has changed, it connects to the same server the last connection was made with autoconnect checked in connection dialog, regardless of the current tab being connected to a different server and the Auto Connection setting for the target SQL Editor is set to None. And I've found no way to disable that. It's a frequent cause of confusion, particularly with those lousy localdb named instances.
Thu Oct 20, 2016 3:58 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
gemisigo wrote:
I requested some years ago a change in behavior to open new connection to the same type and server where the current tab is connected, which is more likely to happen during a workflow, even when connecting to multiple different servers. It worked rather well but now that has changed, it connects to the same server the last connection was made with autoconnect checked in connection dialog, regardless of the current tab being connected to a different server and the Auto Connection setting for the target SQL Editor is set to None. And I've found no way to disable that. It's a frequent cause of confusion, particularly with those lousy localdb named instances.


Is that what the checkbox in DB Connections is for next to the name? I get no context help and all I could figure out is that if you disabled it, it didn't show as a 'default' option/dropdown in a connect dialog if you opened the connect dialog and selected that DB type.
Thu Oct 20, 2016 4:00 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
No, that checkbox only makes it appear it in the connection dialog dropdown. I'm talking about this autoconnect:

If you check it before connecting, pressing Ctrl+N will open your new connection to this very same connection without showing the connection dialog. Remove it and you'll be presented with the dialog again. This is how it works now.
Thu Oct 20, 2016 4:05 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
gemisigo wrote:
No, that checkbox only makes it appear it in the connection dialog dropdown. I'm talking about this autoconnect:

If you check it before connecting, pressing Ctrl+N will open your new connection to this very same connection without showing the connection dialog. Remove it and you'll be presented with the dialog again. This is how it works now.


Gotcha. And there's no corresponding "autoconnect" checkbox in the DB Connections pane for those connections either... where does that get stored aside from a connection dialog box (that I rarely see)?
Thu Oct 20, 2016 4:08 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
What I asked for was to change this behavior so that when you Ctrl+N in a tab, the new tab would autoconnect to the same server the tab you pressed Ctrl+N in had. This way if you wanted another tab to the same server you had it instantly or if you had a tab to the server you wanted and couldn't afford to reuse it (wanted to keep the code or had a running query), you could simply click it and hit Ctrl+N. And if you needed it to another server with no open tabs you'd have to invoke the connection dialog anyway. Now it's not working that way, I had to switch that of, since it is very unlikely that even working with only two servers I'd always like to connect to the same one and autoconnecting to it resulted in having to manually recall connection dialog more often.

Making every tab autoconnect to the same exact server only makes sense in a single server environment, which mine sadly isn't.
Thu Oct 20, 2016 4:14 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
Mindflux wrote:

Gotcha. And there's no corresponding "autoconnect" checkbox in the DB Connections pane for those connections either... where does that get stored aside from a connection dialog box (that I rarely see)?

I guess this should be it:

Thu Oct 20, 2016 4:17 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
gemisigo wrote:
What I asked for was to change this behavior so that when you Ctrl+N in a tab, the new tab would autoconnect to the same server the tab you pressed Ctrl+N in had. This way if you wanted another tab to the same server you had it instantly or if you had a tab to the server you wanted and couldn't afford to reuse it (wanted to keep the code or had a running query), you could simply click it and hit Ctrl+N. And if you needed it to another server with no open tabs you'd have to invoke the connection dialog anyway. Now it's not working that way, I had to switch that of, since it is very unlikely that even working with only two servers I'd always like to connect to the same one and autoconnecting to it resulted in having to manually recall connection dialog more often.

Making every tab autoconnect to the same exact server only makes sense in a single server environment, which mine sadly isn't.


I get that, I just think it's odd that autoconnect checkbox isn't also in the "Db connections" pane, the only way to disable it is to invoke the connection dialog.

It's seemingly a better idea to use a different IDE for each database type at the very least. I can't tell the SQL Editor target options my preference for more than one SQL type anyway, so if I have specific rules or snippets, the only way those would become default is if they were the only ones enabled for that DB type, if I'm not mistaken...
Thu Oct 20, 2016 4:18 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
gemisigo wrote:
Mindflux wrote:

Gotcha. And there's no corresponding "autoconnect" checkbox in the DB Connections pane for those connections either... where does that get stored aside from a connection dialog box (that I rarely see)?

I guess this should be it:


Ah yes, I have that set to my SQL Server, however if I check "Auto Connect" for sqlite3, it becomes my current session 'default' (as you mentioned).. but does NOT change that option in my target preferences. So again it seems like you have to invoke that connect dialog to fiddle with it again.
Thu Oct 20, 2016 4:19 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
I cannot set Auto Connection for a target for connection with type other than the ones with the type set for SQL Assistance. Other than that, my experience is that SQL Editor happily handles several tabs with connections to different types of databases at the same time. Though I haven't tried it yet in v9, I frequently had been using 7.x with SQL Server + MySQL + SQLite databases simultaneously. It worked like a charm.
Thu Oct 20, 2016 4:26 pm View user's profile Send private message
Mindflux



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

Post Reply with quote
gemisigo wrote:
I cannot set Auto Connection for a target for connection with type other than the ones with the type set for SQL Assistance. Other than that, my experience is that SQL Editor happily handles several tabs with connections to different types of databases at the same time. Though I haven't tried it yet in v9, I frequently had been using 7.x with SQL Server + MySQL + SQLite databases simultaneously. It worked like a charm.


Right. So how do you handle if you have customized snippets? Or do you just modify the default snippet for each type?

For me I copy the default snippet collection and re-name it "My Custom MSSQL Snippets" or something, and then set that as my default snippet type for that target.

So, in my case if I had "My custom SQLite3 snippets", the only way (that I can tell) to have those default in SQL Editor that's set up primarily for MSSQL is to disable all the snippet collections except my customized one so that my customized one is the one 'selected' when a new connection/tab is created for a second or third DB type? Which was my main question originally other than the problem with the last autoconnect selection is persistent for that entire session.
Thu Oct 20, 2016 4:35 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
Mindflux wrote:

Right. So how do you handle if you have customized snippets? Or do you just modify the default snippet for each type?

I only have the default snippet collection for each db type. Connecting to another type automatically uses the available snippet. I have different formatting rules for every type but then again, formatting rules have a default too. What's more interesting, which SQL Assistance is going to be used. And for that I've no idea. My default is set to SQL Server 2012. But when using MySQL, I guess it defaults to the last one and I need to use 5.1. My experience is that it's not a good idea to try and modify those using Ctrl+Shift+F5, as it ruins the default for the given target. There's an option called Automatic for SQL Reference when the SQL Assistance is set to SQL Server. Perhaps a something similar could be done for SQL Assistance (and thus the db type) as well.
Thu Oct 20, 2016 4:57 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6499

Post Reply with quote
Here are couple of additional points that could make it easier to understand the behavior

Quote:
I just think it's odd that autoconnect checkbox isn't also in the "Db connections" pane, the only way to disable it is to invoke the connection dialog.

Actually, the last connection with "auto-connect" state should clear that state from all other remembered connections. It's like default connection. There could be only one connection with such state. The problems start when you use multiple development environment for different database types. For example, in SQL Editor you work with MySQL and SQLite, but in Notepad++ with Oracle. This is just a simple demonstration, not a practical situation. So now, in Notepad++ you set your last Oracle connection to auto-connect. What should happen to SQL Editor when you open it? There are several other edge cases like that.


Quote:
my experience is that SQL Editor happily handles several tabs with connections to different types of databases at the same time.

That's correct. It's specifically designed to support multiple database types and enable working with different database types concurrently. You can do the same with some other supported generic editors that rely on SQL Assistant for database operations. At any time if you want to change SQL Assistance type, or other attributes, for example, choose specific version of SQL Reference (this impacts Intellisense too), select different code formatting style, or code snippets collection, etc... in the editor press Ctrl+Shift+F5. It will bring the selection dialog.
Fri Oct 21, 2016 1:06 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 1395

Post Reply with quote
SysOp wrote:
At any time if you want to change SQL Assistance type, or other attributes, for example, choose specific version of SQL Reference (this impacts Intellisense too), select different code formatting style, or code snippets collection, etc... in the editor press Ctrl+Shift+F5. It will bring the selection dialog.

That's good, except that changes made with Ctrl+Shift+F5 are permanent, and that might or might not be the desired goal. For example, I mostly work in SQL Server, with very few occasional trips to MySQL. I open a single tab to a MySQL server and have to change SQL Reference from 5.6 to 5.1. Using Ctrl+Shift+F5 my SQL Editor now default to MySQL unless I use Ctrl+Shift+F5 again to alter settings back to their earlier values.
Fri Oct 21, 2016 3:09 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
Goto page 1, 2  Next
Page 1 of 2

 
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.