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)