<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Clément</title>
    <description>The latest articles on DEV Community by Clément (@clementgpro).</description>
    <link>https://dev.to/clementgpro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4202246%2Fb58c6947-0db0-4560-bdb7-92654acd570a.jpg</url>
      <title>DEV Community: Clément</title>
      <link>https://dev.to/clementgpro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/clementgpro"/>
    <language>en</language>
    <item>
      <title>Following foreign keys in DBeaver, pgAdmin or IntelliJ: one row at a time</title>
      <dc:creator>Clément</dc:creator>
      <pubDate>Fri, 23 Oct 2026 09:53:08 +0000</pubDate>
      <link>https://dev.to/clementgpro/following-foreign-keys-in-dbeaver-pgadmin-or-intellij-one-row-at-a-time-b15</link>
      <guid>https://dev.to/clementgpro/following-foreign-keys-in-dbeaver-pgadmin-or-intellij-one-row-at-a-time-b15</guid>
      <description>&lt;p&gt;You know the drill. Something looks wrong for one company in the database, and to understand what's going on you need to see everything connected to it: its departments, the teams in each department, the employees in each team, their managers.&lt;/p&gt;

&lt;p&gt;I'm not doing this in raw SQL. I use the same tools as most of us: DBeaver, pgAdmin, or the Database tool in IntelliJ. They're great tools. But for this specific job, they all work the same way, and it gets painful fast.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like today
&lt;/h2&gt;

&lt;p&gt;You open the &lt;code&gt;companies&lt;/code&gt; table and find the row. Then you open &lt;code&gt;departments&lt;/code&gt; in another tab and filter on &lt;code&gt;company_id&lt;/code&gt;. Then &lt;code&gt;teams&lt;/code&gt;, filtered on the department you care about. Then &lt;code&gt;employees&lt;/code&gt;. After five minutes, your screen looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3dpj9unj0cxcdj6p7og3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3dpj9unj0cxcdj6p7og3.png" alt="Four table tabs open side by side in an IDE database tool, each filtered by hand" width="799" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Four tabs, four manual filters, and the relationships between them only exist in your head.&lt;/p&gt;

&lt;h2&gt;
  
  
  The real problem: you only see one direction, one row at a time
&lt;/h2&gt;

&lt;p&gt;Most clients let you click a foreign key value and jump to the row it points to. That's useful, but it only goes one way and one row at a time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;From a child, you can reach its parent.&lt;/strong&gt; From a team, you jump to its department.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;From a parent, you don't see its children.&lt;/strong&gt; If a department has 3 teams, nothing on the department row tells you that. You have to know the &lt;code&gt;teams&lt;/code&gt; table exists, open it, and filter on &lt;code&gt;department_id&lt;/code&gt; yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Going deeper multiplies the work.&lt;/strong&gt; Each team has employees, each employee has a manager... Every level is another tab and another filter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The data model is a tree (or a graph), but the tools show it as a pile of flat tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I wanted instead
&lt;/h2&gt;

&lt;p&gt;Pick a record, and expand it like a folder in a file explorer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;its parents (the rows it references)&lt;/li&gt;
&lt;li&gt;its children (the rows that reference it), &lt;strong&gt;all of them, at once&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;and the same thing again on any of those, as deep as I need&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I couldn't find a tool that did exactly that, so I built one: &lt;a href="https://dbtree.app" rel="noopener noreferrer"&gt;DbTree&lt;/a&gt;. Same data as the screenshot above, as a tree:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0lwmbhw6wa5c34hqn0p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk0lwmbhw6wa5c34hqn0p.jpg" alt="The same company expanded into its departments and teams in DbTree" width="800" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It reads the foreign key constraints of your PostgreSQL database and only queries a level when you expand it, so it stays fast on large tables. The connection is read-only.&lt;/p&gt;

&lt;p&gt;To be upfront about the limits: it's Windows-only and PostgreSQL-only for now, it relies on declared foreign keys (no guessing), and it's free up to 2 levels deep, with a one-time license beyond that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Your turn
&lt;/h2&gt;

&lt;p&gt;How do you explore related records day to day? Do you live with the tabs, write the JOINs, or have a trick I'm missing? I'd genuinely like to know.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>sql</category>
      <category>database</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
