SQL Rob

SQL Server and other database technologies

DBeaver

DBeaver

Shortcuts:

F3 or Ctrl + [ : Bring up script window – Choose script or new script
Ctrl + ] : New Script
Ctrl + 6 : Toggle results pane
Ctrl + W : Close script
Alt + X : Execute entire script
Ctrl + Enter : Execute selected block
Ctrl + / : Comment/Uncomment out selected block
Ctrl + 9 : Select data source
Ctrl + 0 (number) : Select DB schema
Ctrl + Shift + O (letter) : Toggle Output pane
Ctrl + PageUp / Ctrl + PageDown : Move through query tabs
Ctrl + O (letter) : Open file
Alt + F : File from menu – Save As
Alt + D : Database from menu – Disconnect
Ctrl + Alt + Space: Templates

Links:
DBeaver User Guide

Connections:
For Postgres, the default is to only show the default database. To see all databases, edit the connection. In Connection Settings, on the Postgres tab, under Settings, check ‘Show All Databases’

Configuration: Some settings I change from the defaults.
Menu : Window => Preferences

Preferences => Editors => SQL Editor : Open output viewer on new messages – I uncheck this option – When checked, the output window is opened with any messages (Like a PRINT from SQL Server).

Preferences => Editors => SQL Editor => Code Editor
Auto Format – Convert keyword case
Auto Close (Single quotes, Double quotes, Brackets)
I don’t like the editor re-formatting my code, or inserting the end parenthesis/bracket for me, so I uncheck these options.

Boolean display in query results: Preferences => Editors – Booleans.
The default is to display [v] or [] for true/false values. With the Label drop-downs, I select true and false.

Line Numbers: Editors => Text Editors – Show Line Numbers – I check this option to show line numbers in the query editor.

Templates: Preferences => Editors => SQL Editor => Templates
I use the Templates feature to store snippets of code I use frequently.

Connection Types:
Right-click connection => Edit Connection => General
Can set a connection type, so that different environments are color-coded
Under Security – Read-only connection