Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View primary key in DBeaver

Tags:

dbeaver

Is there a quick way to view the primary key of a table in DBeaver? Like e.g. in the Eclipse data source explorer, where primary key rows are marked with "PK" and a special symbol.

Eclipse data source explorer

like image 333
hunger Avatar asked Feb 11 '19 10:02

hunger


2 Answers

For a given table, right click on the table name(in Database Navigator) -> select View Diagram.

This will open a window like this containing a single ER Diagram for the table - enter image description here

In this diagram, the primary keys can be seen marked as bold under the table name, in the second partition.

To have a look at the primary keys of all the tables, in the Database Navigator, go to your database and then right click on public -> select View diagram. This will open the ER diagram for the whole database and the connections between the tables. Here, under each table name, the bold columns are the primary keys.

Note: A primary key can be a single key as well as a combination of multiple keys.

like image 177
Anshuman Tiwari Avatar answered Sep 26 '22 17:09

Anshuman Tiwari


As per this github post, some database types (at least MySQL and PostgreSQL) show a small lightbulb to the left of the column name. This is visible in the Properties, Data and ER Diagram tabs.

Example with PostgreSQL:

enter image description here

like image 41
rovyko Avatar answered Sep 22 '22 17:09

rovyko