Pglite
PGlite brings a full PostgreSQL query engine to the browser and Node.js as a lightweight WASM build, weighing under 3MB gzipped. It supports transactions, extensions like pgvector and full-text search, live reactive queries, and multi-tab worker coordination. Ideal for offline-capable apps, local-first architectures, and embedded testing without server infrastructure.
PGlite embeds PostgreSQL 17.4 in browsers and Node.js as a sub-3MB WASM module for client-side SQL queries.
AI-generated summary based on this skill's SKILL.md
Install
oakoss/agent-skills/pglite · repository language: Python
git clone https://github.com/oakoss/agent-skills
cp -r agent-skills ~/.claude/skills/pglitegenerated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub
npx skillfed install oakoss/agent-skills/pgliteFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
What is PGlite and how does it work?
PGlite is a lightweight PostgreSQL implementation compiled to WebAssembly (WASM) that runs directly in browsers and Node.js environments. It brings a full PostgreSQL query engine to client-side applications without requiring server infrastructure, weighing under 3MB gzipped. PGlite supports transactions, extensions like pgvector and full-text search, and enables offline-capable, local-first architectures.
Can I use PGlite as a lightweight postgres alternative?
Yes, PGlite serves as a lightweight postgres alternative for embedded or client-side use cases. It provides a full PostgreSQL query engine in a compact WASM build suitable for web applications, offline scenarios, and local testing. PGlite eliminates the need for server setup while maintaining PostgreSQL compatibility for SQL queries and transactions.
How do I use PGlite in JavaScript and browser environments?
PGlite integrates into JavaScript and browser environments through npm installation and WASM loading. You can execute SQL queries directly in the browser without server setup, leverage live reactive queries for real-time data binding, and coordinate data across multiple tabs using worker support. This makes PGlite ideal for building responsive, offline-capable web applications with local SQL database functionality.
What features does PGlite support?
PGlite supports full transaction handling, PostgreSQL extensions including pgvector for vector search and full-text search capabilities, live reactive queries for dynamic UI updates, and multi-tab worker coordination. These features enable PGlite to power sophisticated local-first applications while maintaining a compact footprint under 3MB gzipped.
Is PGlite suitable for in-memory or local database needs?
Yes, PGlite functions as both an in-memory and persistent local database solution. It integrates seamlessly into web applications for embedded SQL database requirements, supports local data storage without external infrastructure, and enables testing scenarios that previously required full PostgreSQL servers. PGlite's lightweight nature makes it perfect for applications prioritizing offline capability and client-side data management.
How does PGlite compare to SQLite for embedded use?
PGlite brings PostgreSQL's full query engine and advanced features like pgvector and full-text search to browsers and Node.js, whereas SQLite offers a simpler embedded database. PGlite's WASM implementation provides PostgreSQL compatibility and transaction support in under 3MB, making it ideal when you need PostgreSQL functionality without server overhead, while SQLite remains a lighter option for basic embedded database needs.