<?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: Muhammad Waleed</title>
    <description>The latest articles on DEV Community by Muhammad Waleed (@devleed).</description>
    <link>https://dev.to/devleed</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F775483%2F7346c76d-90d0-4b1c-bbbd-9b2ba153d21a.jpeg</url>
      <title>DEV Community: Muhammad Waleed</title>
      <link>https://dev.to/devleed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/devleed"/>
    <language>en</language>
    <item>
      <title>An alternative to PG-Admin with LLM</title>
      <dc:creator>Muhammad Waleed</dc:creator>
      <pubDate>Sat, 11 Apr 2026 15:24:13 +0000</pubDate>
      <link>https://dev.to/devleed/an-alternative-to-pg-admin-with-llm-41pf</link>
      <guid>https://dev.to/devleed/an-alternative-to-pg-admin-with-llm-41pf</guid>
      <description>&lt;h1&gt;
  
  
  Stop Writing SQL Just to Check Your Own Database
&lt;/h1&gt;

&lt;p&gt;There's a moment every backend developer knows.&lt;/p&gt;

&lt;p&gt;You're deep in the zone, building a feature, and suddenly you need to quickly check something in the database. How many users signed up today? Are there any orders stuck in a pending state? What's the latest entry in that table?&lt;/p&gt;

&lt;p&gt;So you stop. You open pgAdmin, wait for it to load, navigate to the right database, open the query tool, write the SQL, run it, check the result, and then try to remember where you were.&lt;/p&gt;

&lt;p&gt;That's five minutes gone. And it happens ten times a day.&lt;/p&gt;

&lt;p&gt;I got tired of it, so I built something to fix it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is DB LLM Console?
&lt;/h2&gt;

&lt;p&gt;DB LLM Console is a self-hosted Docker image that gives you a clean chat UI to query your PostgreSQL database in plain English. You drop it into your existing &lt;code&gt;docker-compose.yml&lt;/code&gt;, give it your DB credentials and an OpenAI API key, and you get a lightweight interface that sits right next to your stack.&lt;/p&gt;

&lt;p&gt;Think of it as a simpler, friendlier alternative to pgAdmin — but instead of writing SQL, you just ask questions.&lt;/p&gt;

&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;orders&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;NOW&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;INTERVAL&lt;/span&gt; &lt;span class="s1"&gt;'7 days'&lt;/span&gt;
&lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'pending'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You type:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Show me pending orders from the last 7 days"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it. It figures out the SQL, runs it against your DB, and shows you the results.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Not Just Use pgAdmin?
&lt;/h2&gt;

&lt;p&gt;pgAdmin is a powerful tool and it absolutely has its place. But for day-to-day development work, it feels like overkill. It's a full DB management suite — connection managers, schema browsers, ERD tools, backup utilities. That's a lot of surface area when all you want is a quick answer.&lt;/p&gt;

&lt;p&gt;DB LLM Console doesn't try to replace pgAdmin for everything. It just handles the most common thing developers actually do: query data and look at results.&lt;/p&gt;




&lt;h2&gt;
  
  
  Setting It Up
&lt;/h2&gt;

&lt;p&gt;Setup is straightforward. Add this to your existing &lt;code&gt;docker-compose.yml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;db-llm-console&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;devleed/db-llm-console:latest&lt;/span&gt;
  &lt;span class="na"&gt;container_name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;db-llm-console-dev&lt;/span&gt;
  &lt;span class="na"&gt;restart&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;unless-stopped&lt;/span&gt;
  &lt;span class="na"&gt;depends_on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;postgres&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;condition&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;service_healthy&lt;/span&gt;
  &lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;DATABASE_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${DATABASE_HOST:-postgres}&lt;/span&gt;
    &lt;span class="na"&gt;DATABASE_PORT&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${DATABASE_PORT:-5432}&lt;/span&gt;
    &lt;span class="na"&gt;DATABASE_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${DATABASE_NAME:-postgres}&lt;/span&gt;
    &lt;span class="na"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${OPENAI_API_KEY}&lt;/span&gt;
  &lt;span class="na"&gt;ports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;127.0.0.1:4000:4000'&lt;/span&gt;
  &lt;span class="na"&gt;networks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;your-network-name&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add your values to your &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="py"&gt;DATABASE_HOST&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;your-db-host&lt;/span&gt;
&lt;span class="py"&gt;DATABASE_PORT&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;5432&lt;/span&gt;
&lt;span class="py"&gt;DATABASE_NAME&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;your-database-name&lt;/span&gt;
&lt;span class="py"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;sk-...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run &lt;code&gt;docker compose up&lt;/code&gt; and open &lt;code&gt;http://localhost:4000&lt;/code&gt;. That's your setup done.&lt;/p&gt;

&lt;p&gt;No extra config files, no new services to maintain, no installation steps beyond what you already do for Docker.&lt;/p&gt;




&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;p&gt;Under the hood it's a Node.js/Express backend that takes your plain English question, sends it to the OpenAI API along with your database schema, gets back a SQL query, runs it against your PostgreSQL database, and returns the results to the React frontend.&lt;/p&gt;

&lt;p&gt;No frameworks like LangChain. Just a direct call to the OpenAI API, keeping the setup lean and the behavior predictable.&lt;/p&gt;

&lt;p&gt;The backend and frontend are bundled together in a single image, so there's only one service to manage. Everything runs on port 4000.&lt;/p&gt;




&lt;h2&gt;
  
  
  A Use Case I Didn't Expect
&lt;/h2&gt;

&lt;p&gt;Here's something that became obvious pretty quickly after building this: it's not just useful for developers.&lt;/p&gt;

&lt;p&gt;Think about the non-technical people on your team or around your project. PMs who want to check product metrics. Clients who want to see their own data without raising a ticket. Stakeholders who ask "how many X do we have this month?" every single week.&lt;/p&gt;

&lt;p&gt;Right now, every one of those questions lands on a developer. Someone has to write the query, pull the data, format it, and send it back. It's a small thing but it adds up.&lt;/p&gt;

&lt;p&gt;With DB LLM Console, you can give those people direct access. They open the chat, type their question in plain English, and get the answer themselves. No SQL knowledge needed. No developer in the loop for routine data questions.&lt;/p&gt;

&lt;p&gt;That change alone frees up a surprising amount of developer time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Security Considerations
&lt;/h2&gt;

&lt;p&gt;This tool has direct access to your database, so it should be treated accordingly.&lt;/p&gt;

&lt;p&gt;A few things to keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bind the port to &lt;code&gt;127.0.0.1&lt;/code&gt; as shown in the docker-compose example above so it is only accessible from your own machine&lt;/li&gt;
&lt;li&gt;Use a read-only database user if you only need to query data and don't want write access exposed&lt;/li&gt;
&lt;li&gt;Never expose this service publicly without authentication&lt;/li&gt;
&lt;li&gt;Never commit your &lt;code&gt;.env&lt;/code&gt; file with real credentials to version control&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Token-based authentication is on the roadmap. For now, treat it as an internal dev tool.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who Is This For?
&lt;/h2&gt;

&lt;p&gt;DB LLM Console is a good fit if you are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A backend developer who wants faster access to their data without context switching&lt;/li&gt;
&lt;li&gt;A team that wants to give non-technical members a way to query data themselves&lt;/li&gt;
&lt;li&gt;Someone building a product for clients who need visibility into their own data&lt;/li&gt;
&lt;li&gt;Anyone who finds pgAdmin too heavy for everyday use&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is available on Docker Hub right now. Pull it, drop it into your stack, and try it out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull devleed/db-llm-console:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Docker Hub: &lt;a href="https://hub.docker.com/r/devleed/db-llm-console" rel="noopener noreferrer"&gt;https://hub.docker.com/r/devleed/db-llm-console&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;If you give it a try, I'd genuinely love to hear what you think. What works, what doesn't, what you'd want added. Drop a comment below.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>database</category>
    </item>
  </channel>
</rss>
