DEV Community

Aleksei Aleinikov
Aleksei Aleinikov

Posted on

🚀 Run PostgreSQL Directly in Your Browser or Node.js!

Imagine running a fully functional PostgreSQL database without a backend! 😲
With PGlite, you get:
✅ Tiny 3MB build – No heavy installs or Docker needed.
✅ Runs anywhere – Browser, Node.js, Bun, Deno – no servers required.
✅ Persistent storage – Save data in IndexedDB or files on disk.
✅ Postgres Extensions – Support for pgvector and more!
📌 Example (JS) – Run SQL in Node.js or the browser

import { PGlite } from "@electric-sql/pglite";

const db = new PGlite();
const { rows } = await db.query("SELECT 'Hello, Postgres in JS!' AS message;");
console.log(rows);

Enter fullscreen mode Exit fullscreen mode

🔗 Read more + full guide 👉
https://javascript.plainenglish.io/launch-a-full-sql-db-in-your-browser-or-node-js-with-ease-4462aa1dd3fb

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay