dbeaver/cloudbeaver

how to pre-load queries from disk

parisni opened this issue · 10 comments

dbeaver AFAIK saves queries on disk. So it's trivial to export them, or preload queries.

Now cloud beaver apparently saves queries within the db or something. So it's kind of complex to pre-load queries for users.

Let's say I want to give users an connection with demonstration queries, now I have to backup the workspace ?
https://github.com/dbeaver/cloudbeaver/wiki/CloudBeaver-Workspace-Backup

Hi @parisni
Scripts for shared connections you can find in workspace/GlobalConfiguration (.sql files).
So you are right - you have to configure a connection and scripts once, and then use that workspace backup for demo.

thanks for your answer. I am not sure to get what you mean by .sql files. I can't find any sql files in workspace/GlobalConfiguration. Also if I add manually sql file there, they don't appear in the ui.

If you have any scripts for shared connections then you will see in GlobalConfiguration folder smth like:

.dbeaver
.project
script-name-1.sql
script-name-2.sql

Scripts for private connections are stored in .dbeaver folder in separated named folders (for each user).

Are you sure that you're trying to add .sql to /cloudbeaver/workspace/GlobalConfiguration for current server? Please, check that you are running and editing the same workspace.

Don't forget you need to restart Cloudbeaver to take these into account

@webketje Scripts are synchronized, as shared scripts could be edited by several users at the same time. So no server restart needed.
But thanks for your comment, it's an important step for changing other server-side settings.

Are you sure that you're trying to add .sql to /cloudbeaver/workspace/GlobalConfiguration for current server? Please, check that you are running and editing the same workspace.

Yes I did. AFter adding the sql files, no one appears in the UI. BTW when I create new scripts from the UI, no sql file can be found in that directory either. Sounds like the scripts are store either in the database, or in the client side, within some firebase .

@parisni
Check that 'Enable Resource Manager' is enabled in Administration UI part.
Also scripts are not created automatically, you should press 'Save as script' button in SQL editor for the first time (SQL editor article).

Could you, please, provide us with a video of creating script in UI.
And also server log on the moment of saving script. Open SQL editor - press 'Save as script'

Thanks for your investigation @parisni