Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Associate SQL Script with Database

Tags:

sql

dbeaver

I have been using DBeaver as a replacement for SQL Server Management Studio, and I am loving it. The only thing I cannot figure out is how to associate a script with a database. For example, in SSMS I can right click a database (let's call it A) in the object explorer and click "New Query" (or ctrl+n) to open a script that is active within database A. If I open another script in a different database (B), that script is associated with the database B. When I switch back to the original script, I am back to working with database A without having to manually select from the database list or executing a USE statement. Obviously, switching back to the second script will make database B active again.

Unfortunately, in DBeaver, there appears to be only one active database for all scripts. Is there a way to set this up in DBeaver to act like SSMS in this manner?

Edit: DBeaver refers to individual databases as catalog/schema. That is what I am trying to associate with individual scripts.

like image 659
Jason Avatar asked Jul 26 '19 19:07

Jason


People also ask

What is a database script?

The Database Scripts project is a series of command line scripts which will dump, erase, restore and merge databases. They are specifically set up to work the best when developing within a version control environment. The primary goals are to: keep the database in sync with code. preserve ability to use the web GUI.


2 Answers

I am using DBeaver community and i have using with multiple DB's. You have to just select Data base from drop down to change DB, it is for current script that open .

i current not have my company system connected , find one sample image from internet . enter image description here

like image 70
Jophy job Avatar answered Sep 27 '22 16:09

Jophy job


I don't know that DBeaver has this capability, but you could always Preface your scripts with the USE DBNAME statement...

like image 36
Acy.Forsythe Avatar answered Sep 27 '22 16:09

Acy.Forsythe