NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm
npm, #3499 most downloaded on npm
PGlite is a WASM Postgres build packaged into a TypeScript client library that enables you to run Postgres in the browser, Node.js and Bun, with no need to install any other dependencies. It is only 3.7mb gzipped.
Latest stable
0.5.16
Last release 13 days ago
09 Nov 2026
Release timing varies
gaps range from 8 days to 2 months
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
3 years old
86 releases · first in 2024
Drag across the ruler to compare, or tap a release to open it.
@electric-sql/pglite-prepopulatedfs@0.5.16
@electric-sql/pglite-prepopulatedfs@0.5.16
pglite.wasm, initdb.wasm and pglite.data so they can be imported by package path (e.g. @electric-sql/pglite/pglite.wasm), and document Nitro/Nuxt support.infinity and -infinity in date, timestamp and timestamptz values as Infinity and -Infinity instead of Invalid Date, and serialize them back to infinity and -infinity.identifier template helper so identifiers containing " produce valid SQL### Patch Changes - Updated dependencies [649dc0e] - Updated dependencies [fe8bdc2] - Updated dependencies [7c62782] - Updated dependencies [84ce5ae]
Your coding agent can read these notes before it upgrades. Set up the MCP server →
TransactionAbortedError when committing an aborted transaction rolls it back instead of silently resolving.### Patch Changes - Updated dependencies [1cf7e86] - Updated dependencies [48dd3fb] - Updated dependencies [268929b] - @electric-sql/pglite@0.5.14
pglite.wasm, initdb.wasm and pglite.data URLs when PGlite has to load them. Passing pgliteWasmModule, initdbWasmModule and fsBundle now works in bundles where import.meta.url is undefined, such as an esbuild IIFE build.### Patch Changes - Updated dependencies [c7dc39e] - Updated dependencies [8364675] - Updated dependencies [a4cfd4d] - Updated dependencies [2db5d2d]
close() now waits for queries, execs and transactions that were issued before it, so they complete instead of failing with Cannot read properties of undefined after teardown.### Patch Changes - Updated dependencies [0641b37] - Updated dependencies [e752dbe] - Updated dependencies [c31130c] - Updated dependencies [0641b37]
FS.utime. Emscripten's FS.utime calls setattr with atime and mtime, but the BaseFilesystem bridge only handled the older timestamp field, so utimes was never called on OPFS AHP or any other BaseFilesystem. Files restored from a tarball kept the time they were written instead of the time stored in the tarball.TZ=UTC, like the backend, so a new database gets timezone = 'UTC' in postgresql.conf. Before, initdb wrote the host's zone as a fixed offset without daylight saving (e.g. Etc/GMT+5 for America/New_York), so timestamptz input without an offset was stored at a different instant on each non-UTC machine.node --permission). Emscripten's NODEFS read the fs open flags with process.binding('constants'), which Node always denies in that mode, so new PGlite() threw ERR_ACCESS_DENIED even for memory://. The bundled build now reads them from require('fs').constants, which holds the same values.loadTar passed the tar header's time to Emscripten's FS.utime in seconds, but FS.utime takes milliseconds. This affected every new database (initdb's data dir is restored from a tarball) and every loadDataDir. With the Node filesystem the files on disk got those dates too.### Patch Changes - Updated dependencies [5573bb0] - Updated dependencies [2372f39] - Updated dependencies [4321a41] - @electric-sql/pglite@0.5.11
### Patch Changes - Updated dependencies [367ee2f] - Updated dependencies [cb06c21] - Updated dependencies [78012ca] - @electric-sql/pglite@0.5.10
live.query (one given offset and limit) leaking its live_query_<id>_get_total_count prepared statement on unsubscribe. Only live_query_<id>_get was deallocated, so the count statement survived every teardown while its backing view was dropped, accumulating dangling prepared statements for the lifetime of the database.### Patch Changes - Updated dependencies [389b731] - Updated dependencies [389b731] - @electric-sql/pglite@0.5.9
### Patch Changes - Updated dependencies [c771db3] - @electric-sql/pglite@0.5.8
### Patch Changes - Updated dependencies [2f9cf75] - @electric-sql/pglite@0.5.7
69b7d87: Apply the second options argument when calling PGlite.create(undefined, options).
PGlite.create(undefined, options).### Patch Changes - Updated dependencies [c6bddde] - @electric-sql/pglite@0.4.5
PGlite.create({ fs }) on a fresh database calling the provided filesystem's init() twice: the inner initdb instance no longer inherits the user-provided fs and always runs on its own scratch filesystem. Previously any VFS holding exclusive resources (e.g. OPFS sync access handles) failed with a contention error on first create.formatQuery (used by live.query/live.incrementalQuery to inline parameters) emitting %NL instead of the positional %N$L format specifier. A bare %NL is "min width N" and consumes format() arguments sequentially, so placeholders that are out of textual order silently bound the wrong values, and repeated placeholders failed with too few arguments for format().Results: command (e.g. SELECT, INSERT, CREATE), and rowCount (the per-statement count from the tag). The tag was already received and parsed internally to compute affectedRows, but these values were not surfaced. Matching node-postgres' command/rowCount result fields lets pg-compatible adapters report them without re-parsing SQL.process.exitCode when closing a PGlite instance. close() calls _emscripten_force_exit(0), whose Emscripten runtime sets process.exitCode = 0, clobbering any exit code the host process had already set. This mirrors the existing save/restore guards in #init() and execProtocolRaw(), so closing a database no longer silently resets the host process's exit code.7e0d6d1: Detect the Node environment via process.type instead of process.versions.electron. The previous Electron guard (#951) also treated the Electr
process.type instead of process.versions.electron. The previous Electron guard (#951) also treated the Electron main and utility processes as non-Node, which broke PGlite's filesystem code path there. process.type only excludes Electron's web contexts (renderer, web worker, service worker), so PGlite keeps using the Node.js path in the Electron main and utility processes. Follow-up to #951 / #813.2ccbb4c: Improve parsing/raw results handling
21fc995: fix serializing arrays of BigInts
930e2d0: fix PGlite version; redeploy external extensions
93d50aa: Upgrade to Postgres 18.3; move other extensions to their own npm packages;
@electric-sql/pglite-pgvector@0.0.7
@electric-sql/pglite-pgvector@0.0.6
@electric-sql/pglite-pgvector@0.0.5
@electric-sql/pglite-pgvector@0.0.4
@electric-sql/pglite-pgvector@0.0.3
@electric-sql/pglite-pgvector@0.0.2
408500c: Allow passing in onError to 'syncShapesToTables'
### Patch Changes - Updated dependencies [ce0e74e] - @electric-sql/pglite@0.3.12
### Patch Changes - Updated dependencies [9a104b9] - @electric-sql/pglite@0.3.11
8785034: Added pg_uuidv7 extension.
ad3d0d8: Updated pg_dump to use callback data exchange; built pg_dump with emscripten
ce0e74e: Added pgTAP extension.
9a104b9: Added dict_int, dict_xsyn, file_fdw, intarray, pageinspect, pg_buffercache, pg_freespacemap, pg_surgery, pg_visibility, pg_walinspect, unacce
ad765ed: initdb calls system to query the server configs. avoid that by hardcoding a return value of 123
### Patch Changes - e40ccad: Upgrade emsdk
f12a582: Ensure MessageContext and its children are actually cleared between queries
0936962: nested exception bugfix; wasm runtime exception fix
469be18: bug fix in packaging the distribution
### Patch Changes - Updated dependencies [c6bddde] - @electric-sql/pglite@0.4.5
### Patch Changes - Updated dependencies [b88c5c3] - @electric-sql/pglite@0.4.4
### Patch Changes - Updated dependencies [2ae666f] - Updated dependencies [fb95e66] - Updated dependencies [65fc101] - @electric-sql/pglite@0.4.3
### Patch Changes - Updated dependencies [41632c4] - @electric-sql/pglite@0.4.2
cma data transfer container to file for large queries, and fix errors that could result in a "memory access out of bounds" error.### Patch Changes - Updated dependencies [37fb39e] - @electric-sql/pglite@0.4.1
initialInsertMethod option that can specify insert, csv or json as the method used to handle the initial sync. The supersedes the useCopy option which is now deprecated and will be removed in a future version.97e52f7: upgrade to postgresql 17.4
0033bc7: Fix a race condition in live query unsubscription that could result in live queries failing to update.
97e52f7: upgrade to postgresql 17.4
### Patch Changes - Updated dependencies [ce0e74e] - @electric-sql/pglite@0.3.12
commitGranularity parameter in the syncShapeToTable function, enabling the user to choose how often the sync should commit.syncShapeToTablestop() already detached from touching the database again. A client socket that closed in the same event-loop turn as stop() queued its own detach, which ran after db.close() and failed with an unhandled TypeError: Cannot read properties of undefined (reading '_IsTransactionBlock').### Patch Changes - Updated dependencies [9a104b9] - @electric-sql/pglite@0.3.11
.transaction methodrefreshArrayTypes() call to re-sync newly created complex array columns, like enums### Patch Changes - Updated dependencies [ad765ed] - @electric-sql/pglite@0.3.10
ECONNRESET or an idle timeout). Previously only a clean close removed the handler, so maxConnections filled up and new connections were refused until the server restarted.### Patch Changes - e40ccad: Upgrade emsdk - Updated dependencies [e40ccad] - @electric-sql/pglite@0.3.9
runExclusive method on PGlite that allows you to hold an exclusive lock on the database, for use with execProtocol* methodsexecProtocolRawSync method that can execute a postgres wire protocol synchronouslyoffset and limit option to live queries, when used it will return the total count for the query along with efficient updating of the offset. This works well with windowed or virtualised scrolling components.offset and limit option to live queries, when used it will return the total count for the query along with efficient updating of the offset. This works well with windowed or virtualised scrolling components.electric.syncing config flag in Postgres during a sync transaction to enable user defined triggers to chose how to run during a sync.DELETE FROM rather than a TRUNCATE on must-refetch so that custom merge logic can be applied with triggers.useCopy option to syncShapeToTable, when true performs a COPY TO for the initial sync.be677b4: fix pg_dump on Windows systems
be677b4: fix pg_dump on Windows systems
When calling pg_dump on Windows system the function fails with an error as the one bellow.
❗ Notice the double drive letter
Error: ENOENT: no such file or directory, open 'E:\C:\Users\<USERNAME>\AppData\Local\npm-cache\_npx\ba4f1959e38407b5\node_modules\@electric-sql\pglite-tools\dist\pg_dump.wasm'
The problem is in execPgDump function at line
const blob = await fs.readFile(bin.toString().slice(7))
I think the intention here was to remove file:// from the begging of the path. However this is not necesarry readFile can handle URL objects.
Moreover this will fail on Windows becase the slice creates a path like '/C:/<USERNAME>...' and the readFile function will add the extra drive letter
Updated dependencies [f12a582]
Updated dependencies [bd263aa]
describeQuery method to get type information about a query's parameters and result fields without executing it.limit 1 it would return no rowsPGliteOptions. Added custom serializer option to QueryOptions.useLiveQuery. This allows you to create a live query in a react-router loader, then pass it to the route component where it is then attached with useLiveQuery.### Patch Changes - Updated dependencies [0936962] - @electric-sql/pglite@0.3.7
util to package.json browser config to exclude it in browser builds### Patch Changes - Updated dependencies [6898469] - Updated dependencies [469be18] - Updated dependencies [64e33c7] - @electric-sql/pglite@0.3.6
### Patch Changes - 8172b72: new pg_dump wasm blob - Updated dependencies [6653899] - Updated dependencies [5f007fc] - @electric-sql/pglite@0.3.5
Apache-2.0 AND GPL-2.0-or-later, as the bundled PostGIS is GPL-licensedfs/promises: false to the browser config in package.json to exclude it from browser builds.38a55d0: fix cjs/esm misconfigurations
@electric-sql/pglite-pg_hashids@0.0.6
@electric-sql/pg-protocol to bundle types correctly@electric-sql/pglite-pg_hashids@0.0.5
### Patch Changes - Updated dependencies [69b7d87] - Updated dependencies [6c14380] - @electric-sql/pglite@0.5.6
29f5617: Handle PostgreSQL CancelRequest wire protocol messages
Added support for the CancelRequest message that some clients and connection proxies send during the connection startup phase. PGlite has no backend process to cancel, so the request is consumed and silently ignored (the protocol expects no response), which prevents it from being misinterpreted as a malformed startup/typed message. This complements the existing SSLRequest handling.
incrementalQuery and changes APIs not working when keyed on non-integer primary keys like TEXT and UUID.### Patch Changes - Updated dependencies [a290741] - Updated dependencies [6b6f28d] - Updated dependencies [354f4ae] - Updated dependencies [219af1e]
tx.sql`` API to PGliteWorker transactions..create(dataDir: string, options: PGliteOptions) signature for factory method to match constructor.ddl_command_end.### Patch Changes - Updated dependencies [7e0d6d1] - @electric-sql/pglite@0.5.4
pg-protocol with vendored version and remove Buffer polyfill.7f6ee05: Handle the SSLRequest startup packet per the PostgreSQL wire protocol: when SSL is not available, respond with N so the client may continue w
SSLRequest startup packet per the PostgreSQL wire protocol: when SSL is not available, respond with N so the client may continue with a cleartext StartupMessage. Improves interoperability with JDBC clients such as DBeaver that probe TLS first without requiring manual SSL mode tweaks. See https://www.postgresql.org/docs/current/protocol-message-formats.html .sql tagged template literal method for querying, along with helpers.@electric-sql/pglite-pg_hashids@0.0.3
@electric-sql/pglite-pg_hashids@0.0.2
dumpDataDir method and fix a bug that prevented compression when used in a worker.One column per month.