explaingit

electric-sql/pglite

15,208TypeScript

TLDR

PGlite is a version of PostgreSQL, one of the world's most popular relational databases (a structured way to store and query data), compiled to run entirely inside a web browser or JavaScript runtime, with no server required.

Mindmap

A visual breakdown will appear here once this repo is fully enriched.

In plain English

PGlite is a version of PostgreSQL, one of the world's most popular relational databases (a structured way to store and query data), compiled to run entirely inside a web browser or JavaScript runtime, with no server required. It uses WebAssembly (WASM), a technology that lets languages like C be compiled and run directly in browsers or JavaScript environments. The package weighs only 3 MB compressed and can be installed via npm like any other JavaScript library. Once imported, you can run SQL queries directly in your app, no installation, no server to manage. You can run it as a temporary in-memory database (data disappears when you close the tab) or with persistence: in the browser it saves data to indexedDB (a built-in browser storage system), and in Node.js, Bun, or Deno it saves to the local filesystem. It also supports Postgres extensions including pgvector (used for AI similarity searches). PostgreSQL normally works by forking a new operating system process for each connection, but WebAssembly does not support forking processes. PGlite works around this by using PostgreSQL's single-user mode, a minimal operating mode normally used for bootstrapping, and adding a custom input/output pathway for JavaScript interaction. As a result, PGlite only supports one connection at a time. It is dual-licensed under Apache 2.0 and the PostgreSQL License and is built by ElectricSQL.

Open on GitHub → Explain another repo

Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.