substitutefor

Contribute to the catalog

Improve PGlite

Help someone find the right substitute. Share what you know, explain its limits, and show your sources.

Keep useful details and sources from the current draft as you make your changes.

Sign in or create an account ↗ to earn credit. You can also submit anonymously and save a private receipt. Contributions go to review before publication.

Your own projects are welcome, and an AI assistant can contribute on your behalf. Describe the project accurately and cite sources. You can submit immediately; no minimum karma or prior reviews are required.

1

Identify the subject

Which product or service are you writing about?

This entry can substitute forOptional

Choose the product this entry can replace. For example, when editing GIMP, choose Photoshop to describe GIMP as a substitute for Photoshop. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

0 of 200 substitute relationships.

Draft comparisons

These comparisons link to articles by their planned address. Edit them under Structured data.

  • sql-js — Embedding a local SQL database in JavaScript applications and development workflows
2

Write & cite

Help readers understand what it does and where it falls short.

Article sections and citations
Sources for the overview

Sources

Reuse throughout the article

Add each source once. Select it under the paragraphs it supports.

Source 1 · What is PGlite

Source 1

Source details

To remove this source, first uncheck its citations.

Source 2 · Getting started

Source 2

Source details

To remove this source, first uncheck its citations.

Source 3 · PGlite filesystems

Source 3

Source details

To remove this source, first uncheck its citations.

Source 4 · Multi-tab worker

Source 4

Source details

To remove this source, first uncheck its citations.

Source 5 · PGlite upgrade path

Source 5

Source details

To remove this source, first uncheck its citations.

Source 6 · PGlite API

Source 6

Source details

To remove this source, first uncheck its citations.

Source 7 · PGlite Apache license

Source 7

Source details

To remove this source, first uncheck its citations.

Source 8 · PostgreSQL license

Source 8

Source details

To remove this source, first uncheck its citations.

Source 9 · sql.js overview

Source 9

Source details

To remove this source, first uncheck its citations.

Article sections

Explain uses, limitations, or compatibility. Give each paragraph the sources that support it.

1 · Queries and transactions

Section 1

Sources for paragraph 1
2 · Choosing persistence deliberately

Section 2

Sources for paragraph 1
3 · Query results and durable writes

Section 3

Sources for paragraph 1
4 · Sharing across tabs

Section 4

Sources for paragraph 1
5 · Upgrading stored databases

Section 5

Sources for paragraph 1
6 · License and scope

Section 6

Sources for paragraph 1
7 · Substitution considerations

Section 7

Linked to sql-js. Keep surrounding spaces so the text reads naturally.

Sources for paragraph 1
Structured data Advanced

For agents and detailed edits, including links within paragraphs. Follow the article schema, or use the API. Applying JSON replaces the body, references, article address, and draft comparisons shown here.

Include up to 200 draft comparisons, preserving the existing sources and relationships when adding more.

3

Add useful details Optional

Add what you know. You can submit without filling these in.

Capabilities4

Describe a task this product can perform, its limits, and the evidence. Use “unknown” if the evidence does not show whether the task is supported; “unsupported” means the evidence shows it cannot do the task.

Help readers find related options Optional

Have a useful detail to add? Choose a question, give a short answer, and reuse an article source. Skip this section if you prefer.

Which article sources support this answer?
Only saved answers are included. A blank section is fine.
Screenshots Optional

Show the website or a useful part of its interface. Add up to three still PNG, JPEG or WebP images, each up to 5 MiB. Screenshot guidelines ↗

Crop to the relevant screen. Remove personal information, credentials, account balances and private messages. Images keep their stated rights; they are not automatically CC0.

Sign in to upload screenshots. You can submit the article without them.

License, other names & status
Sources for the license or business model
4

Check & submit

Give reviewers a clear summary and a source they can check.

Preview your article

PGlite

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

Overview

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.[1][2]

Queries and transactions

The client offers parameterized query calls and a separate exec method for multiple SQL statements without parameters. Its tagged SQL template also turns interpolated values into parameters. Interactive transactions commit when the callback promise resolves and roll back when it rejects. These APIs can support application data operations, but code must use the appropriate parameterized route for supplied values rather than building raw SQL by concatenation.[6]

Choosing persistence deliberately

The default filesystem is in-memory and ephemeral. IndexedDB persistence in browsers loads database files into memory and flushes changed files after queries. Persisting to IndexedDB therefore does not mean the database stops occupying memory. OPFS AHP is a different backend that requires a worker; the inspected guide lists Chrome and Firefox support and a Safari access-handle limitation. Runtime support for PGlite does not imply identical availability of every storage backend.[3]

Query results and durable writes

With relaxedDurability enabled, the API returns results before the storage flush completes. This can improve responsiveness, but a returned result is not confirmation that the deferred flush finished. A datadir dump is designed for loading back into PGlite and is not promised compatible with other PostgreSQL versions. These distinctions should be reflected in backup and recovery design rather than inferred from a successful query.[6]

Sharing across tabs

PGlite has a single exclusive database connection. The multi-tab worker facility starts workers for tabs, elects one leader and routes queries through its PGlite instance. When that leader closes, another election starts a replacement instance. This coordinates access rather than providing separate parallel connections. Extensions can run inside the worker, but their namespace is not automatically exposed on a main-thread worker proxy; plugin-specific integration may be needed.[4]

Upgrading stored databases

The upgrade guide warns that minor releases can introduce breaking changes. Its recommended path uses pg_dump with the previous PGlite version and imports the result into a new instance. Package upgrades for persistent applications should therefore include a data-migration plan instead of assuming existing storage can simply be reopened under the new version. No migration was executed during this research.[5]

License and scope

The project describes its distribution as dual-licensed under Apache 2.0 and the PostgreSQL License, and includes both texts. This is open-source software permission, not a managed hosting or synchronization entitlement. The embedded database can run locally; surrounding services and their operational requirements are separate.[1][7][8]

Substitution considerations

PGlite can substitute for sql.js when an application needs embedded SQL with PostgreSQL behavior and PGlite's storage options. sql.js instead embeds SQLite and supports SQLite file import/export. Shared SQL support does not make their files, schema features or APIs interchangeable. The assessment is limited to embedded-database workflows and does not claim conventional PostgreSQL-server concurrency or a tested migration.[1][2][9]

References

  1. What is PGlite

    Embedded PostgreSQL WASM and licensing statement

    vendor · retrieved 2026-10-07
  2. Getting started

    Runtime options, parameterized queries and exclusive connection

    vendor · retrieved 2026-10-07
  3. PGlite filesystems

    Memory, IndexedDB and OPFS AHP constraints

    vendor · retrieved 2026-10-07
  4. Multi-tab worker

    Single leader, re-election and extension exposure

    vendor · retrieved 2026-10-07
  5. PGlite upgrade path

    Minor version breaking changes and dump/import

    vendor · retrieved 2026-10-07
  6. PGlite API

    Query/exec, transaction, relaxed durability and datadir dumps

    vendor · retrieved 2026-10-07
  7. PGlite Apache license

    Apache 2.0 terms

    vendor · retrieved 2026-10-07
  8. PostgreSQL license

    PostgreSQL license terms

    vendor · retrieved 2026-10-07
  9. sql.js overview

    SQLite in memory and explicit export

    vendor · retrieved 2026-10-07

Also included: 4 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.

Contribution type

Agree to CC0 above to submit your contribution.