Select DB Datasource for project .sql files

I have quite a few .sql files which contain various queries that I use day-to-day. I also have a few DB Datasources set up in 0xDBE for my project. When I first ran one of the queries, I got a small popup that asked me which datasource to use for the query. Since then I've wanted to use the query on a different datasource but I cannot find where I can change the Datasource for a .sql file.

Is there a simple way to do this that I'm missing?

See attached. The first attachment is the popup I seem to only get when 0xDBE is first opened and the query is run for the first time. Any subsequent running of the query assumes my choice until I close 0xDBE and reopen it.



Attachment(s):
Screenshot 2015-09-30 09.35.40.png
9 comments
Comment actions Permalink

I've found the answer. In the bottom right corner there is a context selection.

See attached image. One can attach and detatch the current .sql/console to datasources in your project using this selector.

Thanks!



Attachment(s):
Screenshot 2015-09-30 12.12.12.png
0
Comment actions Permalink

Unfortunately I'm having the same issue, however it doesn't appear to be giving me the option to make that selection.



Attachment(s):
Screenshot2015-11-05.png
0
Comment actions Permalink

Hello Matthew,

How do you select query for execution? Can you run query from Alt+Enter intention action? Can you please attach idea.log (Help | Show/Reveal Log in...) action? Thank you.

0
Comment actions Permalink

Attaching DB Console to a SQL file could not work for Scratchs file (by default located in USER_HOME/.0xDBE10/config/consoles folder. It should work if you create SQL File via File view:
Untitled.png

0
Comment actions Permalink

My issue is specifically with .sql files attached in the File explorer window, and it occurs before I can even get a returned event log. To preface this, I am using a Cisco Composite driver (Yes, a non native driver on an EAP license. But the universal nature of 0xDBE lends itself to CIS implementations) I'm not able to show any detail from my code itself (Proprietary environment), however this screenshot can hopefully shed a little light on the issue. When performing an Alt+Enter intention action I'm only able to see my two Oracle environments. Not the specific Composite connection I would like to use.



Attachment(s):
CompositeIssue.png
0
Comment actions Permalink

Are you able to connect to the database using mentioned driver? What does Test Connection action in configured Datasource return?

0
Comment actions Permalink

I've been able to connect fully to the environment and have been running queries against it for the last couple of weeks. I'm only however able to run those queries against the console for that specific connection. I did notice the issue arose when I began adding additional database connections (Oracle). It seems having ONLY the one data connection forced it to default to the only available environment, however having options caused it to ignore the non-standard drivers in lieu of those native to 0xDBE.



Attachment(s):
TestConnection.png
0
Comment actions Permalink

As I think on this more. Is it possible the issue is entirely due to my reliance on custom drivers for my Composite connectivity? With that reliance on custom drivers, I have no ability to declare a Composite dialect (im using Oracle for the time being as it matches on about 95% of my code). Would that lack of Composite dialect, coupled with the fact that I'm forcing an Oracle dialect, while I have oracle data connections be causing this? If so, are you aware of any plans on Composite driver/dialect integration in the future? If not, is there a way to clone the Oracle dialect, and use it as a basis for a custom dialect?

0
Comment actions Permalink

If you have Oracle dialect specified for the file IDE will offer you only Oracle Datasources to run from the intention action. To be able to run the file agains Generic Datasource, please set dialect to the 'Generic' one.

Please also make sure to use the last build from https://www.jetbrains.com/dbe/download/, as there were fixes, related to this behavior ( https://youtrack.jetbrains.com/issue/DBE-1929 ).

0

Please sign in to leave a comment.