news.volyx.in

PGlite – Embeddable Postgres (pglite.dev)

605 points by dsego · 232 days ago · 115 comments on HN

Article summary

PGlite is an embeddable Postgres database that can run locally in WASM, allowing for reactivity and live sync. It is a complete WASM build of Postgres under 3MB Gzipped and supports dynamic extension loading. PGlite can be used for local development environments, unit testing, and emulating server products. It is dual-licensed under Apache 2.0 and the PostgreSQL License.

Main themes

  • Embeddable databases
  • Postgres alternatives
  • WASM and reactivity
  • Local development environments
  • Unit testing and CI
  • Database extensions

What commenters say

  • PGlite has the potential to replace SQLite for local development and testing due to its more comprehensive SQL functionality and stricter type checking.
  • The embeddability of PGlite makes it a useful tool for local-first applications and can simplify the development process.
  • Some commenters question the usefulness of PGlite, suggesting that existing libraries and drivers for connecting to databases would not work with it.
  • PGlite's WASM-only approach is seen as a limitation by some, who would prefer a lib-ification approach for broader compatibility.
  • The ability to compile PGlite as a native library would increase its versatility and appeal to a wider range of developers.
  • PGlite has already found success in various use cases, including local unit-testing, emulating server products, and CI pipelines.
  • The correlation between downloads and actual usage of PGlite is uncertain, and some commenters argue that deployment counts are not a reliable metric.
  • The potential for PGlite to support local-first single-user applications and syncing with the file system API is an exciting area of exploration.