Skip to content
ElectricElectric
PricingBlog
Main Navigation
Go to Cloud
Cloud
Go to Cloud
On this page

← Blog

Announcing PGlite v0.4: PostGIS, connection multiplexing, and a new architecture

By Tudor Zaharia and Sam Willis

Are you an LLM? You can read better optimized documentation at /blog/2026/03/25/announcing-pglite-v04.md for this page in Markdown format

PGlite v0.4 is out. This release brings PostGIS support, connection multiplexing, and a major architectural refactor that decouples initdb from the main WASM binary — setting up PGlite's foundation for native ports and multi-connection support.

PGlite now sees over 13 million weekly downloads across all packages. From CI testing to vibe coding with a database in the sandbox, PGlite is showing up everywhere. Here's what's new.

🪧  Quicklinks

PGlite is a WASM build of Postgres that runs inside your JavaScript environment — in the browser, Node.js, Bun, and Deno.

  • v0.4 release on GitHub
  • Extension catalog
  • Discord · GitHub

What's new in v0.4 ​

A cleaner architecture ​

A guiding principle for PGlite is keeping our Postgres fork as close to upstream as possible. The less we change, the easier it is to upgrade, maintain, and accept contributions. We rely on vanilla Emscripten for the build and keep external build dependencies in a Docker builder so the environment is reproducible on any host.

The biggest win in v0.4 is refactoring how initdb works. Previously, initdb was embedded inside the final WASM executable, requiring hacks that had to be maintained across fork updates. Now, initdb runs as a separate WASM process. PGlite intercepts its system calls to provide the necessary plumbing — stdin/stdout redirection and filesystem sharing via Emscripten's PROXYFS — without changing any initdb code.

initdb PostgreSQL plumbing in PGlite
initdb and Postgres are separate WASM processes — PGlite provides the communication plumbing by intercepting system calls

This mirrors how a native PostgreSQL deployment works, making the codebase easier to understand for new contributors. The same pattern extends to other Postgres client tools without needing changes to their code.

PostGIS ​

PostGIS adds support for storing, indexing, and querying geospatial data. For many developers, it's the reason they choose Postgres. Now it runs in PGlite.

Getting here wasn't trivial. PostGIS has many dependencies, all of which needed WASM builds. Chrome's 8MB limit on synchronously loading dynamic libraries added another constraint. The community stepped in and helped us deliver it.

Thanks to @StachowiakDawid and @larsmennen for their work on this.

Connection multiplexing ​

PGlite runs in Postgres single-user mode, which means a single connection. Many client tools expect to open multiple connections, and this has been a friction point.

@nickfujita contributed a PR that multiplexes concurrent connections over PGlite's single connection. This unblocks compatibility with tooling that previously couldn't work with PGlite's single-connection constraint.

Community extensions ​

The community has taken our extension build docs and run with them. Extensions now shipping in production include pg_uuidv7, pgTAP, pg_hashids, and Apache AGE. Thanks also to @loredanacirstea for help bringing pgcrypto to PGlite.

These come on top of the contrib extensions we bundle by default. See the full extension catalog.

Growth ​

Over the past year, PGlite has grown from ~500k to over 13 million weekly downloads across all packages. Prisma now bundles PGlite in their CLI for local development — try it with npx prisma dev. We're seeing more community activity on HN, more external PRs on GitHub, and adoption across CI/CD pipelines, browser-based IDEs, and developer tooling.

Get started ​

Install PGlite:

bash
npm install @electric-sql/pglite

Basic usage:

typescript
import { PGlite } from '@electric-sql/pglite'

const db = new PGlite()
await db.exec('CREATE TABLE test (id serial PRIMARY KEY, name text)')
await db.exec("INSERT INTO test (name) VALUES ('hello')")
const result = await db.query('SELECT * FROM test')

Check out the extension catalog to add PostGIS, pgvector, and more.

Coming next ​

  • libpglite — a native library built directly from Postgres source, with bindings for multiple languages. This unlocks mobile and desktop use cases, starting with React Native.
  • Multi-instance — true multi-connection support, exploring both cooperative and multi-threaded (WebWorker) approaches. We're also monitoring the threading work in Postgres as a longer-term path.
  • Replication — enabling Postgres logical replication to expand what PGlite can participate in.

Join us on Discord, star us on GitHub, and check out the PGlite docs to get started.

Many thanks to all our contributors and users — your support keeps us going.

ElectricElectric

AboutContactLegalDocsDemosBlogSign up
TanStack DBPGliteXBlueskyDiscordGitHub

© 2026 Electric DB Inc. Released under the Apache 2.0 License.

✨ Markdown