# PGlite

Embedded WebAssembly PostgreSQL with JavaScript APIs and optional browser or filesystem persistence\.

ID: Q974 · Revision: 1022

Type: software · License: Apache\-2\.0 and PostgreSQL License, described by the project as dual licensing[^about][^apache][^postgres] · Status: active

Website: https://pglite.dev/



PGlite packages PostgreSQL compiled to WebAssembly behind a JavaScript and TypeScript client\. It can run in a browser or JavaScript runtime without a separately installed PostgreSQL server\. Its embedded model suits local application data and development tasks, but it has different connection and persistence constraints from a conventional database server\.[^about][^start]

## Capabilities and substitutions

### Embedded PostgreSQL — supported

WASM PostgreSQL executes through JavaScript APIs without a separate server installation\.[^about]

Use case: Embedding a local SQL database in JavaScript applications and development workflows · Platforms: Web, JavaScript, TypeScript, Node\.js, Bun, Deno · Region: Version, build and integration requirements apply

### Browser persistence — limited

IndexedDB loads files into memory; OPFS AHP needs a worker and is documented as unsupported in Safari\.[^fs]

Use case: Embedding a local SQL database in JavaScript applications and development workflows · Platforms: Web, JavaScript, TypeScript, Node\.js, Bun, Deno · Region: Version, build and integration requirements apply

### Multiple browser tabs — limited

Worker wrapper proxies requests to one elected leader instance, not independent concurrent database connections\.[^worker]

Use case: Embedding a local SQL database in JavaScript applications and development workflows · Platforms: Web, JavaScript, TypeScript, Node\.js, Bun, Deno · Region: Version, build and integration requirements apply

### Unchanged database files across upgrades — limited

Minor upgrades can break compatibility; documented path is dump and import\.[^upgrade][^api]

Use case: Embedding a local SQL database in JavaScript applications and development workflows · Platforms: Web, JavaScript, TypeScript, Node\.js, Bun, Deno · Region: Version, build and integration requirements apply

### [Substitute for sql\.js](/sqljs) — limited

Can replace embedded SQL storage when PostgreSQL semantics are wanted; SQLite files, dialect and persistence APIs require migration\.[^about][^sqljs]

Use case: Embedding a local SQL database in JavaScript applications and development workflows · Platforms: Web, JavaScript, TypeScript, Node\.js, Bun, Deno · Region: Version, build and integration requirements apply

## References

[^about]: [What is PGlite](<https://pglite.dev/docs/about>) — Embedded PostgreSQL WASM and licensing statement (vendor; retrieved 2026-10-07T23:43:41Z)

[^start]: [Getting started](<https://pglite.dev/docs/>) — Runtime options, parameterized queries and exclusive connection (vendor; retrieved 2026-10-07T23:43:30Z)

[^fs]: [PGlite filesystems](<https://pglite.dev/docs/filesystems>) — Memory, IndexedDB and OPFS AHP constraints (vendor; retrieved 2026-10-07T23:43:41Z)

[^worker]: [Multi\-tab worker](<https://pglite.dev/docs/multi-tab-worker>) — Single leader, re\-election and extension exposure (vendor; retrieved 2026-10-07T23:43:48Z)

[^upgrade]: [PGlite upgrade path](<https://pglite.dev/docs/upgrade>) — Minor version breaking changes and dump/import (vendor; retrieved 2026-10-07T23:43:48Z)

[^api]: [PGlite API](<https://pglite.dev/docs/api>) — Query/exec, transaction, relaxed durability and datadir dumps (vendor; retrieved 2026-10-07T23:44:12Z)

[^apache]: [PGlite Apache license](<https://github.com/electric-sql/pglite/blob/main/LICENSE>) — Apache 2\.0 terms (vendor; retrieved 2026-10-07T23:44:12Z)

[^postgres]: [PostgreSQL license](<https://github.com/electric-sql/pglite/blob/main/POSTGRES-LICENSE>) — PostgreSQL license terms (vendor; retrieved 2026-10-07T23:44:12Z)

[^sqljs]: [sql\.js overview](<https://github.com/sql-js/sql.js/blob/master/README.md>) — SQLite in memory and explicit export (vendor; retrieved 2026-10-07T23:43:41Z)

Source revision: https://substitutefor.net/entities/Q974?revision=1022
