---
title: "psql from the browser"
description: "psql.sh is a browser-based emulation of Postgres's psql client, built on Neon's WebSocket proxy and serverless driver because browsers can't open raw TCP connections."
url: "https://swe.quest/articles/psql-from-the-browser-f27b7186b8abd76b"
canonical: "https://neon.com/blog/psql-from-the-browser"
source: "Neon"
published: "2024-12-11"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 3
tags: ["postgres","browsers","developer-tools","open-source"]
---

# psql from the browser

A post on [Neon](https://swe.quest/sources/neon.md), published 2024-12-11, 3 min read, Announcement. Original: [https://neon.com/blog/psql-from-the-browser](https://neon.com/blog/psql-from-the-browser)

## Summary

psql.sh is a browser-based emulation of Postgres's psql client, built on Neon's WebSocket proxy and serverless driver because browsers can't open raw TCP connections. Each session gets a fresh, isolated database by creating a child branch from a template branch, which yields a connection string almost instantly. Slash commands like \\d reuse the Neon SQL Editor's library. The terminal UI was built from scratch instead of using xterm.js, since only a psql session needs emulating. The project is open source.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- psql basics

## Keywords

psql, Neon, psql.sh, WebSocket proxy, Neon serverless driver, xterm.js

## Related posts

- [Web-based AI SQL Playground and connecting to Postgres from the browser](https://swe.quest/articles/web-based-ai-sql-playground-and-connecting-to-postgres-from-the-browser-fa7f4eccd9643a37.md): Neon · 2023-05-19 · Medium · 5 min read · PostgreSQL, LLMs, Serverless, JavaScript
  Neon's Postgres AI Playground connects to a Postgres database directly from the browser and uses OpenAI's gpt-3.5-turbo to turn natural-language prompts into SQL.
- [Bringing psql’s \\d to your web browser](https://swe.quest/articles/bringing-psql-s-d-to-your-web-browser-032015b940df37e2.md): Neon · 2024-04-17 · Medium · 6 min read · PostgreSQL, JavaScript, Developer tools
  Neon's web SQL Editor now supports psql backslash introspection commands like \\d, \\l, \\dx and \\sf, which live in psql's C client code rather than the Postgres server.
- [Shipping psql without psql: a pure-TypeScript Postgres client in neonctl](https://swe.quest/articles/shipping-psql-without-psql-a-pure-typescript-postgres-client-in-neonctl-621e0ac130c536d1.md): Neon · 2026-06-12 · Medium · 7 min read · PostgreSQL, TypeScript, Testing, AI for coding, Developer tools
  neonctl now embeds a pure-TypeScript reimplementation of psql that activates when no native psql is on the PATH.
- [Live Share: Connect to in-browser PGlite with any Postgres client](https://swe.quest/articles/live-share-connect-to-in-browser-pglite-with-any-postgres-client-bc4a637942fe2ca5.md): Supabase · 2024-10-10 · Medium · 6 min read · PostgreSQL, Networking, Load balancing, WebAssembly, Browsers
  database.build (formerly postgres.new) adds Live Share, which exposes an in-browser PGlite (WASM Postgres) database via a unique connection string usable from psql, pg\_dump, ORMs or IDEs.
- [How Does psql -h pg.neon.tech Work?](https://swe.quest/articles/how-does-psql-h-pg-neon-tech-work-b4339dcc3b96f63b.md): Neon · 2024-08-14 · Medium · 3 min read · PostgreSQL, Identity & auth, Networking
  Neon's passwordless \`psql -h pg.neon.tech\` connects to a "Link Proxy", a server that speaks the Postgres wire protocol, rather than to a real Postgres instance.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
