<?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: Kamdev Choudhary</title>
    <description>The latest articles on DEV Community by Kamdev Choudhary (@kamdev_choudhary_be2c3da7).</description>
    <link>https://dev.to/kamdev_choudhary_be2c3da7</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%2F4270255%2F38c617a9-19b9-4c6c-90f0-a68a494e47f2.jpg</url>
      <title>DEV Community: Kamdev Choudhary</title>
      <link>https://dev.to/kamdev_choudhary_be2c3da7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kamdev_choudhary_be2c3da7"/>
    <language>en</language>
    <item>
      <title>One command, full Postgres GUI: meet pgdeck</title>
      <dc:creator>Kamdev Choudhary</dc:creator>
      <pubDate>Sat, 28 Nov 2026 07:10:45 +0000</pubDate>
      <link>https://dev.to/kamdev_choudhary_be2c3da7/one-command-full-postgres-gui-meet-pgdeck-3fa8</link>
      <guid>https://dev.to/kamdev_choudhary_be2c3da7/one-command-full-postgres-gui-meet-pgdeck-3fa8</guid>
      <description>&lt;p&gt;I spend a lot of time inside PostgreSQL. Most days I want to do something small: look at a few rows, fix one value, check why a query is slow, or load a CSV someone sent me.&lt;/p&gt;

&lt;p&gt;For that, the usual options always felt like too much. A desktop app to install and update, a Docker container to run, or a config file to write. Or I'd just use &lt;code&gt;psql&lt;/code&gt;, which is great until you want to scroll through 18,000 rows or edit a timestamp without typos.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;pgdeck&lt;/strong&gt;: a full web UI for Postgres that starts with one command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx pgdeck postgres://user:password@localhost:5432/mydb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the whole setup. It connects, starts a local web app, and prints a URL and a login:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  pgdeck v0.1.6

  ✓ Connected   mydb as postgres (PostgreSQL 18.1)
    Databases   12 available (switch in the UI)
  ➜ Web UI      http://127.0.0.1:47615/
    Listening   127.0.0.1:47615
    Login       admin / 3fH9kQ2xLmP_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the link and you're in. No Docker, no config file, no desktop app.&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%2Fajudhrzkhexg9or3zl08.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%2Fajudhrzkhexg9or3zl08.png" alt="pgdeck live overview with connections, transactions per second, cache hit ratio and sessions" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A live overview of your database
&lt;/h3&gt;

&lt;p&gt;The first screen shows what's happening right now, streamed over a WebSocket: connections, transactions per second, rows read and written, cache hit ratio and running sessions.&lt;/p&gt;

&lt;p&gt;Below that are health checks I always end up writing by hand: tables with lots of dead rows, missing indexes, tables that were never analyzed and sessions stuck "idle in transaction". The affected tables can be vacuumed or analyzed in one click.&lt;/p&gt;

&lt;p&gt;You can also switch between &lt;strong&gt;every database on the server&lt;/strong&gt; from the header (or with &lt;code&gt;⌘K&lt;/code&gt;) without restarting anything.&lt;/p&gt;

&lt;h3&gt;
  
  
  A data grid that respects your types
&lt;/h3&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%2Fuel29kpxsh42iroopldl.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%2Fuel29kpxsh42iroopldl.png" alt="pgdeck data grid showing an orders table" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sort, paginate and filter with &lt;code&gt;=&lt;/code&gt;, &lt;code&gt;≠&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;contains&lt;/code&gt;, &lt;code&gt;starts with&lt;/code&gt;, &lt;code&gt;in&lt;/code&gt;, &lt;code&gt;like&lt;/code&gt;, &lt;code&gt;is null&lt;/code&gt; and more, combined with AND or OR.&lt;/p&gt;

&lt;p&gt;Foreign key columns show what they reference. You can preview the referenced row from any cell and jump straight to it.&lt;/p&gt;

&lt;p&gt;Editing picks the right input for each column type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;enum columns get a dropdown&lt;/li&gt;
&lt;li&gt;booleans get a toggle&lt;/li&gt;
&lt;li&gt;dates and timestamps get a calendar, and the timezone offset is preserved&lt;/li&gt;
&lt;li&gt;JSON gets an editor with validation&lt;/li&gt;
&lt;li&gt;UUIDs can be generated&lt;/li&gt;
&lt;li&gt;any field can be set to &lt;code&gt;NULL&lt;/code&gt; or &lt;code&gt;DEFAULT&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2Fxp9rlrb6bkpksi74bm2t.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%2Fxp9rlrb6bkpksi74bm2t.png" alt="Editing a row in pgdeck with type-aware inputs" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One decision I'm happy with: pgdeck reads every value as &lt;strong&gt;Postgres' own text representation&lt;/strong&gt; and sends edits back the same way, so Postgres does the casting. That means &lt;code&gt;bigint&lt;/code&gt; and &lt;code&gt;numeric&lt;/code&gt; never lose digits to JavaScript numbers, and timestamps keep their precision and timezone. If you can type it in &lt;code&gt;psql&lt;/code&gt;, it works in the editor.&lt;/p&gt;

&lt;h3&gt;
  
  
  A SQL editor with query plans
&lt;/h3&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%2Fev84epllfz4ouyfe0vs0.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%2Fev84epllfz4ouyfe0vs0.png" alt="pgdeck SQL editor" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The editor has syntax highlighting, table autocomplete, multiple statements, error position highlighting and per-database history. &lt;code&gt;⌘ Enter&lt;/code&gt; runs the selection or the whole editor.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;⌘ ⇧ Enter&lt;/code&gt; explains the statement as a &lt;strong&gt;plan tree&lt;/strong&gt;: time per step, estimated vs. actual rows, the slowest step highlighted, and plain-language warnings like "this filter discards most rows" or "this sort spilled to disk". &lt;em&gt;Explain analyze&lt;/em&gt; runs the query for real timings inside a transaction that is always rolled back, so it's safe on &lt;code&gt;UPDATE&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; too.&lt;/p&gt;

&lt;p&gt;The overview also lists the slowest queries from &lt;code&gt;pg_stat_statements&lt;/code&gt; (with setup help if it's off), and you can cancel a query or terminate a session from there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Schema management without writing DDL
&lt;/h3&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%2F22rgrxv50z0k1xqjg6f8.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%2F22rgrxv50z0k1xqjg6f8.png" alt="pgdeck table structure view" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create tables with a column builder and a live SQL preview&lt;/li&gt;
&lt;li&gt;Add, rename, retype and drop columns&lt;/li&gt;
&lt;li&gt;Create indexes (multi-column, unique, partial, btree/gin/gist/brin/hash, &lt;code&gt;CONCURRENTLY&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;An interactive &lt;strong&gt;ER diagram&lt;/strong&gt; you can export as PNG or SVG&lt;/li&gt;
&lt;li&gt;Roles and permissions: a privilege grid where you tick boxes, review the SQL, and save it in one transaction&lt;/li&gt;
&lt;li&gt;Functions, triggers, sequences and extensions, all editable in place&lt;/li&gt;
&lt;/ul&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%2Fer4oopssgtsjol8gtuqi.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%2Fer4oopssgtsjol8gtuqi.png" alt="Creating a table in pgdeck with a live SQL preview" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Import and export gigabytes
&lt;/h3&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%2Ffg9b7drnnxee2lddtx2f.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%2Ffg9b7drnnxee2lddtx2f.png" alt="Streaming a CSV import into Postgres with pgdeck" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Imports &lt;strong&gt;stream&lt;/strong&gt; CSV, TSV or JSON Lines files (gzipped too) straight into Postgres using &lt;code&gt;COPY&lt;/code&gt;. Nothing is buffered in memory, so file size doesn't matter. It all runs in one transaction: if row 2,000,001 is bad, everything rolls back and you're told the exact line.&lt;/p&gt;

&lt;p&gt;Exports work the same way in reverse. Export everything that matches your filters (streamed from a server-side cursor), the current page or selected rows, as CSV, TSV, JSON, JSON Lines, SQL &lt;code&gt;INSERT&lt;/code&gt;s or Markdown.&lt;/p&gt;

&lt;p&gt;You can also &lt;strong&gt;back up and restore whole databases&lt;/strong&gt;: a &lt;code&gt;pg_dump&lt;/code&gt;-style &lt;code&gt;.sql&lt;/code&gt; (optionally gzipped) taken from one consistent snapshot, or a ZIP with the schema plus one data file per table. Restore accepts &lt;code&gt;pg_dump&lt;/code&gt; backups too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Secure by default
&lt;/h2&gt;

&lt;p&gt;A web UI for your database needs to be careful, so pgdeck starts locked down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Login required&lt;/strong&gt;, with a random password printed at each start (or set your own with &lt;code&gt;--password&lt;/code&gt; / &lt;code&gt;PGDECK_PASSWORD&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Binds to &lt;strong&gt;&lt;code&gt;127.0.0.1&lt;/code&gt;&lt;/strong&gt; unless you pass &lt;code&gt;--host&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSRF protection&lt;/strong&gt; on every API call, and WebSocket origin checks&lt;/li&gt;
&lt;li&gt;Rate-limited login attempts&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;&lt;code&gt;--readonly&lt;/code&gt;&lt;/strong&gt; mode that opens every session read-only and turns off editing in the UI
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Read-only look at production, with a fixed password&lt;/span&gt;
&lt;span class="nv"&gt;PGDECK_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'correct horse battery staple'&lt;/span&gt; npx pgdeck &lt;span class="s2"&gt;"$DATABASE_URL"&lt;/span&gt; --readonly
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also works behind nginx, Caddy or Traefik. It's one port with relative URLs, and there's an optional &lt;code&gt;--base-path&lt;/code&gt; if you want to serve it under &lt;code&gt;/db&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it's built
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; &lt;a href="https://hono.dev" rel="noopener noreferrer"&gt;Hono&lt;/a&gt; on Node.js, with &lt;a href="https://node-postgres.com" rel="noopener noreferrer"&gt;node-postgres&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UI:&lt;/strong&gt; React, TanStack Query, &lt;a href="https://ui.shadcn.com" rel="noopener noreferrer"&gt;shadcn/ui&lt;/a&gt;, Tailwind CSS and CodeMirror&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build:&lt;/strong&gt; Vite for the UI and tsdown for the CLI, bundled into a single self-contained npm package&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Building pgdeck taught me a few things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Never trust JavaScript numbers with database values.&lt;/strong&gt; Keeping everything as Postgres text was the simplest way to never lose precision.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stream everything.&lt;/strong&gt; &lt;code&gt;COPY FROM STDIN&lt;/code&gt; and server-side cursors mean a 5 GB import uses about as much memory as a 5 KB one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero-install is a feature.&lt;/strong&gt; If trying a tool takes one command, people actually try it.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;You need Node.js 20+ and PostgreSQL 12+.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx pgdeck postgres://postgres@localhost:5432 --open
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;⭐ GitHub: &lt;a href="https://github.com/kamdev-choudhary/decktools" rel="noopener noreferrer"&gt;https://github.com/kamdev-choudhary/decktools&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📦 npm: &lt;a href="https://www.npmjs.com/package/pgdeck" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/pgdeck&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🌐 Website: &lt;a href="https://kamdev-choudhary.github.io/decktools/pgdeck/" rel="noopener noreferrer"&gt;https://kamdev-choudhary.github.io/decktools/pgdeck/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;pgdeck is open source (MIT) and still young, so feedback really helps. If something breaks or a feature is missing, please &lt;a href="https://github.com/kamdev-choudhary/decktools/issues" rel="noopener noreferrer"&gt;open an issue&lt;/a&gt;. And if it saves you some time, a star on GitHub means a lot. 🙏&lt;/p&gt;

&lt;p&gt;What do you use to manage Postgres day to day? I'd love to hear about it in the comments.&lt;/p&gt;

</description>
      <category>database</category>
      <category>postgres</category>
      <category>showdev</category>
      <category>tools</category>
    </item>
  </channel>
</rss>
