PGLite · full Postgres, in your browser tab

Run real Postgres,
right in the browser

PGLite compiles a complete PostgreSQL 16 engine to WebAssembly. Prototype instantly, develop locally, then deploy the same Postgres on Silos — zero setup, zero servers, zero compromise on SQL.

Open the playground Read the docs
Under 3 MB Fast in-process startup Offline capable
play.silos.shPGLite · WASM
Run in-browser · no serverPostgreSQL 16 (PGLite) · ~3 MB
1CREATE TABLE todos (
2 id SERIAL PRIMARY KEY,
3 title TEXT NOT NULL,
4 done BOOLEAN DEFAULT false
5);
6 
7SELECT title, done FROM todos
8WHERE done = false ORDER BY id;
CREATE TABLE · 3 rows · 0.8 mspersisted to OPFS
titledone
Ship local-first syncfalse
Wire up pgvector searchfalse
Seed demo datasetfalse
WASM
Powered
Full SQL
Standard
Offline
Capable
< 3 MB
Bundle
How it works

A complete database that runs where your code does

Every layer of PGLite is built for the browser. From storage to sync, we handle the hard parts so you can focus on building.

Full PostgreSQL, compiled to WASM
PGLite compiles a complete PostgreSQL 16 engine to WebAssembly via Emscripten. Not a SQL subset or compatibility layer — the real engine, with triggers, stored procedures, CTEs, and window functions. Under 3 MB gzipped.
Persistent in-browser storage
Data persists through your browser's native APIs — IndexedDB for maximum compatibility, or OPFS for performance on larger datasets. Everything survives page refreshes and browser restarts.
In-process startup
No network round-trips. PGLite initializes entirely in-process by loading the WASM module in your tab, and subsequent starts read from cached storage. No connection pool, no cold-start queue.
Develop local, deploy on Silos
Write and test against PGLite in the browser, then deploy the same Postgres on Silos. Browser-to-edge sync is an evolving capability via the @silos/pglite-sync plugin — start local-first today and adopt sync as it matures.
pgvector, pg_trgm & more
PostgreSQL extensions that compile to WASM load directly in PGLite — add pgvector for embeddings or pg_trgm for fuzzy search. Heavier server extensions (e.g. TimescaleDB, Citus) don't run in WASM and aren't available in the browser.
Current capabilities

Real Postgres, right where you build

PGLite is electric-sql's open-source PostgreSQL-in-WebAssembly. These are the capabilities available today.

Zero setup

Instant dev environment

npm install, import, query. No Docker, no CLI, no database servers, no config files. Full PostgreSQL in three lines of code — every developer on the team gets an identical environment.

Offline-first

Works without a network

PGLite stores data locally in the browser via IndexedDB or OPFS. Your application works offline by default — reads and writes hit the local database in-process, with no server round-trip required.

Same engine

Standard SQL, browser to server

Develop against PGLite in the browser, then deploy your schema and queries to Postgres on Silos. Both run real PostgreSQL and speak standard SQL, so what works locally is built on the same engine in production.

Developer experience

Three lines to a full database

PGLite is designed for developers who want PostgreSQL without the ops overhead.

app.ts
1import { PGlite } from "@silos/pglite"
2
3const db = new PGlite()
4
5await db.exec(`
6 CREATE TABLE IF NOT EXISTS todos (
7 id SERIAL PRIMARY KEY,
8 title TEXT NOT NULL,
9 done BOOLEAN DEFAULT false,
10 created_at TIMESTAMP DEFAULT NOW()
11 )
12`)
13
14const { rows } = await db.query(
15 "SELECT * FROM todos WHERE done = $1",
16 [false]
17)

Develop locally. Deploy on Silos.
The same Postgres, end to end.

Comparison

The full breakdown

FeaturePGLitesql.js (SQLite)Server Postgres
Runs in the browser
EnginePostgreSQL 16SQLitePostgreSQL
Bundle size< 3 MB gzipped~1 MBN/A
StartupIn-processIn-processServer connection
Offline support
Full SQLLimited
Extensions (in WASM)pgvector, pg_trgm…Server-side
Local-first development
FAQ

Frequently asked questions

Common questions about PGLite, browser databases, and local-first development with Silos.

Ready to build with PGLite?

Start prototyping with full PostgreSQL in your browser. Open the playground, install the npm package, or talk to our team about enterprise deployment.