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.
Every layer of PGLite is built for the browser. From storage to sync, we handle the hard parts so you can focus on building.
PGLite is electric-sql's open-source PostgreSQL-in-WebAssembly. These are the capabilities available today.
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.
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.
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.
PGLite is designed for developers who want PostgreSQL without the ops overhead.
1import { PGlite } from "@silos/pglite"23const db = new PGlite()45await 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`)1314const { rows } = await db.query(15 "SELECT * FROM todos WHERE done = $1",16 [false]17)
| Feature | PGLite | sql.js (SQLite) | Server Postgres |
|---|---|---|---|
| Runs in the browser | — | ||
| Engine | PostgreSQL 16 | SQLite | PostgreSQL |
| Bundle size | < 3 MB gzipped | ~1 MB | N/A |
| Startup | In-process | In-process | Server connection |
| Offline support | — | ||
| Full SQL | Limited | ||
| Extensions (in WASM) | pgvector, pg_trgm… | — | Server-side |
| Local-first development | — |
Common questions about PGLite, browser databases, and local-first development with Silos.
Start prototyping with full PostgreSQL in your browser. Open the playground, install the npm package, or talk to our team about enterprise deployment.