Page 1 of 1

Auto database selection (set active)

PostPosted: Sun Aug 26, 2012 3:05 pm
by lorenzo-s
I found a little annoying the fact that databases are not auto-selected (automatically set as active, I mean) when I open their object tree or when I open a contained table.

In a typical scenario, I open DBeaver, I browse the tree until a table (my connection > Databases > my database > Tables > my table), view some data, then I want to run some SQL (CTRL+L to open SQL editor), I write down some code then I execute it (CTRL+Enter). Execution will fail because no database is selected. That can be fixed if the application assumes I want to operate on my database because I opened it in the tree view or because I clicked a table in it.

Re: Auto database selection (set active)

PostPosted: Sun Sep 09, 2012 12:53 pm
by Serge
Hi,

I'm afraid I didn't completely understand the problem.
Currently when you open SQL editor DBeaver detects current database using
1. Active editor
2. Current selection in database navigator
If there is no open editor and you have no selection in navigator then DBeaver will ask you which datasource to use.
Could you provide exact steps to reproduce this problem?

Thanks

Re: Auto database selection (set active)

PostPosted: Wed Nov 11, 2015 4:33 pm
by sithboi
Hello,

I know this is opening an old thread but I didn't want to open a new one for the same topic.

Moving from other IDE's to this one, I believe what he means is when you open the SQL Editor that the currently selected database in the navigation is not what appears at the top for the server. Using DBViz as an example, if I hit Ctrl+T it'll open a new sql editor with my currently selected database/schema at the top. In DBeaver you have to right click, set active, and then open the SQL editor with the ctrl+L or ctrl+alt+L combinations. This is one feature I like about other IDE's as it keep my hands on the keyboard and I don't have to use other mouse clicks; it also avoid the MASTER or last used database to be queried against.

New Edit:
I would say the fix could be when you hit ctrl + L that it checks to see if the database you have selected is the active one if not, auto set it as active, and open a new sql editor window.