I have a number of .sql
files that I wish to execute through DBeaver. Traditional database development programmes allow the user to edit and run SQL scripts (totally or partially) in the same window, but this is not obvious with DBeaver.
When I open a .sql
script some drop down boxes in the button bar appear, that seem to serve as connection selectors. But none of the connections I have defined appear in these drop down boxes. It is possible to open a SQL console on database objects in the Database Navigation view, but not on SQL scripts.
How can I execute a SQL script, totally or partially, against a particular database connection with DBeaver?
For larger files, the more optimally it is edit the .sql file in an external editor and then in DBeaver:
This approach is generally more convenient and faster for large files.
To do this without an external editor, you must: