{"id":2359,"date":"2025-03-12T07:03:23","date_gmt":"2025-03-12T07:03:23","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2025\/03\/12\/7-powerful-dbeaver-tips-and-tricks-to-improve-your-sql-workflow\/"},"modified":"2025-03-12T07:03:23","modified_gmt":"2025-03-12T07:03:23","slug":"7-powerful-dbeaver-tips-and-tricks-to-improve-your-sql-workflow","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2025\/03\/12\/7-powerful-dbeaver-tips-and-tricks-to-improve-your-sql-workflow\/","title":{"rendered":"7 Powerful DBeaver Tips and Tricks to Improve Your SQL Workflow"},"content":{"rendered":"<p>    7 Powerful DBeaver Tips and Tricks to Improve Your SQL Workflow<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/dbeaver\/dbeaver\">DBeaver<\/a> is the most powerful open-source SQL IDE, but there are several features people don\u2019t know about. In this post, I will share with you several features to speed up your workflow, with zero fluff.<\/p>\n<p class=\"wp-block-paragraph\">I\u2019ve learned these as I\u2019m currently digging deeper into the tools I use daily, starting with <a href=\"https:\/\/towardsdatascience.com\/tag\/dbeaver\/\" title=\"Dbeaver\">Dbeaver<\/a>. In a future post, I\u2019ll compare the workflow between DBeaver versus building your SQL development environment on VSCode (or Cursor). If you\u2019re interested in that, be sure to follow my publications!<\/p>\n<p class=\"wp-block-paragraph\">Today, though, the focus is on learning the cool features of DBeaver. Let\u2019s get started.<\/p>\n<h2 class=\"wp-block-heading\">The Command Palette<\/h2>\n<p class=\"wp-block-paragraph\">This is one of the most powerful yet hidden features in DBeaver. Maybe people overlook it because it\u2019s not called a \u201cCommand Palette\u201d. You can open it with <strong>CMD + 3 (Mac) or CTRL + 3 (Windows)<\/strong>.<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" data-dominant-color=\"39393a\" data-has-transparency=\"false\" style=\"--dominant-color: #39393a;\" fetchpriority=\"high\" decoding=\"async\" width=\"601\" height=\"564\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-1.png?resize=601%2C564&#038;ssl=1\" alt=\"\" class=\"wp-image-599513 not-transparent\" srcset=\"https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-1.png 601w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-1-300x282.png 300w\" sizes=\"(max-width: 601px) 100vw, 601px\"><\/figure>\n<p class=\"wp-block-paragraph\">From here, you can access basically any action in the IDE. I mostly use it for:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Switching between <a href=\"https:\/\/towardsdatascience.com\/tag\/sql\/\" title=\"Sql\">Sql<\/a> scripts.<\/li>\n<li class=\"wp-block-list-item\">Navigating to specific settings.<\/li>\n<li class=\"wp-block-list-item\">Quickly accessing actions like Export Results, Refresh Schema, Open Templates, Rename File, etc.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">(Officially, this feature in DBeaver is called \u201cFind Actions.\u201d)<\/p>\n<h2 class=\"wp-block-heading\">Custom SQL formatter<\/h2>\n<p class=\"wp-block-paragraph\">Did you know you can easily set up a different formatter in DBeaver? I\u2019m personally not a fan of the default formatting, and since I mainly use PostgreSQL, I prefer pg_formatter.<\/p>\n<p class=\"wp-block-paragraph\">Let me show you how it works to set up pg_formatter, but keep in mind that the process will be similar for any SQL formatter that you can call via the terminal.<\/p>\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\"># Install PG Formatter\nbrew install pgformatter\n\n# Find where the program is located.\n# In my case: opt\/homebrew\/bin\/pg_format\nwhich pg_format<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Next, go to<strong> Preferences \u2192 Editors \u2192 SQL Editor \u2192 Formatting, select an \u201cExternal Formatter,\u201d<\/strong> and then paste the path to your desired formatter.<\/p>\n<p class=\"wp-block-paragraph\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/s.w.org\/images\/core\/emoji\/15.0.3\/72x72\/1f4a1.png?ssl=1\" alt=\"\ud83d\udca1\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\"> Or you can simply open the command palette and search for \u201cFormatting\u201d.<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" data-dominant-color=\"4e5253\" data-has-transparency=\"false\" style=\"--dominant-color: #4e5253;\" decoding=\"async\" width=\"1000\" height=\"253\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-2.png?resize=1000%2C253&#038;ssl=1\" alt=\"\" class=\"wp-image-599514 not-transparent\" srcset=\"https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-2.png 1000w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-2-300x76.png 300w, https:\/\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-2-768x194.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\"><\/figure>\n<h2 class=\"wp-block-heading\">Expand columns on SELECT<\/h2>\n<p class=\"wp-block-paragraph\">Often, you might need to select most columns from a table, excluding just a few. DBeaver makes this easier by expanding your SELECT * into explicit column names.<\/p>\n<p class=\"wp-block-paragraph\">You can do this with the <strong>CTRL + Space<\/strong> hotkey, both on Mac or on Windows. This might not work if you have it bound to another system shortcut, in which case you can look up for \u201cContent Assist\u201d in the command palette.<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" data-dominant-color=\"2e2e2d\" data-has-transparency=\"false\" style=\"--dominant-color: #2e2e2d;\" decoding=\"async\" width=\"1014\" height=\"698\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-3.gif?resize=1014%2C698&#038;ssl=1\" alt=\"\" class=\"wp-image-599515 not-transparent\"><\/figure>\n<h2 class=\"wp-block-heading\">Quickly find column statistics<\/h2>\n<p class=\"wp-block-paragraph\">DBeaver has a bunch of features to speed up your analysis. One of them that I use frequently is the \u201cCalc tab\u201d, located to the right of your query results. It lets you quickly get the information about columns in your query results.<\/p>\n<p class=\"wp-block-paragraph\">Here is what you can do with it:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Find the amount of unique and non-null values of categorical columns.<\/li>\n<li class=\"wp-block-list-item\">Get min, max, mean, median, etc., of numerical columns.<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"586\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-4.gif?resize=802%2C586&#038;ssl=1\" alt=\"\" class=\"wp-image-599516\"><\/figure>\n<p class=\"wp-block-paragraph\">Very handy for quickly understanding your dataset!<\/p>\n<h2 class=\"wp-block-heading\">Ad-hoc groups<\/h2>\n<p class=\"wp-block-paragraph\">Similarly to the Calc tab, the \u201cGroupings tab\u201d lets you quickly create group-by queries without writing SQL manually.<\/p>\n<p class=\"wp-block-paragraph\">What you can do with it:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Quickly count occurrences of values.<\/li>\n<li class=\"wp-block-list-item\">Add multiple aggregations.<\/li>\n<\/ul>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"922\" height=\"398\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-6.gif?resize=922%2C398&#038;ssl=1\" alt=\"\" class=\"wp-image-599519\"><\/figure>\n<p class=\"wp-block-paragraph\">Although this one is pretty nice for simple aggregations, I find it a bit underwhelming as there is no way to count unique values, as I do in the GIF above, without having to manually write the metric function.<\/p>\n<h2 class=\"wp-block-heading\">SQL templates<\/h2>\n<p class=\"wp-block-paragraph\">SQL Templates are extremely powerful, although I admit I don\u2019t use them as often as I should. Templates save you from repeatedly writing common expressions.<\/p>\n<p class=\"wp-block-paragraph\">You can see the built-in templates by opening the command palette and searching for \u201cTemplates\u201d. You will see shortcuts for:<\/p>\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\"><code>SELECT * FROM {table}<\/code><\/li>\n<li class=\"wp-block-list-item\"><code>SELECT * FROM {table} WHERE {col} = {value}<\/code><\/li>\n<li class=\"wp-block-list-item\">And others, like selecting and ordering, counting by groups, etc.<\/li>\n<\/ul>\n<p class=\"wp-block-paragraph\">All you need to do is to write the shorthand for the query and press tab:<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" data-dominant-color=\"2f2f2e\" data-has-transparency=\"false\" style=\"--dominant-color: #2f2f2e;\" loading=\"lazy\" decoding=\"async\" width=\"716\" height=\"274\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-7.gif?resize=716%2C274&#038;ssl=1\" alt=\"\" class=\"wp-image-599521 not-transparent\"><\/figure>\n<p class=\"wp-block-paragraph\">You can also create your own templates, which is not hard if you just copy the existing ones and adapt them.<\/p>\n<h2 class=\"wp-block-heading\">Advanced copy tips<\/h2>\n<p class=\"wp-block-paragraph\">You might already know DBeaver has extensive data export options. However, the standard export wizard can feel a bit overwhelming, as it shows you tons of configurations, even when you just want to quickly export a CSV.<\/p>\n<p class=\"wp-block-paragraph\">A quicker way is selecting data in the Results tab, right-clicking, and choosing \u201cAdvanced Copy\u201d. By doing this, you can copy your data in many formats like CSV, JSON, Markdown, TXT, and even SQL Insert Statements.<\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"710\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-9.gif?resize=824%2C710&#038;ssl=1\" alt=\"\" class=\"wp-image-599522\"><\/figure>\n<p class=\"wp-block-paragraph\">I find this one super helpful, especially when I need to quickly send data to a teammate.<\/p>\n<p class=\"wp-block-paragraph\">A bonus tip is that you can copy this data to TSV, which gets properly recognized by Excel and Google Sheets into their proper cells! For this one though, you have to be double advanced, according to DBeaver <img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/s.w.org\/images\/core\/emoji\/15.0.3\/72x72\/1f605.png?ssl=1\" alt=\"\ud83d\ude05\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\"><\/p>\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" data-dominant-color=\"393939\" data-has-transparency=\"false\" style=\"--dominant-color: #393939;\" loading=\"lazy\" decoding=\"async\" width=\"818\" height=\"626\" src=\"https:\/\/i0.wp.com\/towardsdatascience.com\/wp-content\/uploads\/2025\/03\/DBeaver-10.gif?resize=818%2C626&#038;ssl=1\" alt=\"\" class=\"wp-image-599523 not-transparent\"><\/figure>\n<h2 class=\"wp-block-heading\">Conclusions<\/h2>\n<p class=\"wp-block-paragraph\">I love DBeaver as a SQL IDE. It\u2019s incredibly powerful and the interface is very clean. It\u2019s honestly mindblowing that this tool is free and open-source. If you haven\u2019t tried it yet, I recommend it a lot!\u00a0<\/p>\n<p class=\"wp-block-paragraph\">I haven\u2019t seen that many people talking about some of its nicest features and tricks, and most tips I\u2019ve shared came from just using the software. There is probably a lot that I missed, especially when it comes to Plugins, which I haven\u2019t used much.<\/p>\n<p class=\"wp-block-paragraph\">I know I went through all of the tips very fast, so if you\u2019re in doubt, feel free to reach out. Also, if you have more workflow tips, I would love to hear about them!<\/p>\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-dotted\">\n<p class=\"wp-block-paragraph\">I hope you learned something new!<\/p>\n<p class=\"wp-block-paragraph\">If you\u2019re curious about other tips that didn\u2019t make it into this post, or enjoy learning about general data topics, <strong>subscribe to my <\/strong><a href=\"https:\/\/mtrentz.substack.com\/\"><strong>free newsletter on Substack<\/strong><\/a>. I publish whenever I have something genuinely interesting to share.<\/p>\n<p class=\"wp-block-paragraph\">Want to connect directly or have questions? <strong>Reach out anytime at <\/strong><a href=\"https:\/\/mtrentz.com\/\"><strong>mtrentz.com<\/strong><\/a><strong>.<\/strong><\/p>\n<p class=\"wp-block-paragraph\"><em>All images and animations, unless otherwise noted, are by the author<\/em><\/p>\n<p>The post <a href=\"https:\/\/towardsdatascience.com\/7-powerful-dbeaver-tips-and-tricks-to-improve-your-sql-workflow\/\">7 Powerful DBeaver Tips and Tricks to Improve Your SQL Workflow<\/a> appeared first on <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Mateus Trentz<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/7-powerful-dbeaver-tips-and-tricks-to-improve-your-sql-workflow\/\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>7 Powerful DBeaver Tips and Tricks to Improve Your SQL Workflow DBeaver is the most powerful open-source SQL IDE, but there are several features people don\u2019t know about. In this post, I will share with you several features to speed up your workflow, with zero fluff. I\u2019ve learned these as I\u2019m currently digging deeper into [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,401,83,1805,2002,404,158],"tags":[2003,2004,1187],"class_list":["post-2359","post","type-post","status-publish","format-standard","hentry","category-aimldsaimlds","category-data-engineering","category-data-science","category-databases","category-dbeaver","category-sql","category-tips-and-tricks","tag-dbeaver","tag-formatter","tag-sql"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2359"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=2359"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/2359\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=2359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=2359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=2359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}