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
Decision gist · record as of 2026-03-02
PGlite embeds PostgreSQL 17.4 in browsers and Node.js as a sub-3MB WASM module for client-side SQL queries. 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.
Use it when
- Yes, PGlite serves as a lightweight postgres alternative for embedded or client-side use cases.
- PGlite integrates into JavaScript and browser environments through npm installation and WASM loading.
Install
oakoss/agent-skills/pglite · repository language: Python
generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently 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.
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Find a lightweight PostgreSQL implementation for embedded or client-side use”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
This framework guides you through adopting local-first architecture for web applications, from deciding whether it fits your use case to selecting sync engines, client-side storage solutions, and conflict resolution approaches. It covers when local-first makes sense—collaborative apps, latency-sensitive UIs, unreliable networks—and when simpler server-based patterns are better.
Drizzle ORM is a lightweight TypeScript ORM that delivers compile-time type safety while mapping directly to SQL across PostgreSQL, MySQL, and SQLite. It combines a SQL-like query builder with a relational queries API, serverless compatibility, and zero dependencies for full control over your database layer.
ElectricSQL streams partial replicas of Postgres data to client apps in real time using Shapes, handling the read path with logical replication while writes flow through your existing API. Set up Shape requests with filtering and column selection, implement auth proxies to control access per user, and choose write patterns ranging from online-only to through-the-database strategies.
TanStack DB is a reactive client store that extends TanStack Query with typed collections, live queries, and optimistic mutations. It normalizes data for sub-millisecond cross-collection queries and delivers instant optimistic updates with automatic rollback. Use it for apps needing local-first data, real-time sync via ElectricSQL, or complex joins that outgrow per-query caching.
Turso is a globally distributed SQLite platform built on libSQL that combines edge-hosted databases with embedded replicas for low-latency local reads. It supports vector similarity search, multi-database per-tenant architectures, batch operations, and integrates with Drizzle ORM for schema management. Use it for applications requiring offline-capable replicas, programmatic database provisioning, or distributed deployments.
Nuxthub extends Nuxt with backend services including a type-safe database layer via Drizzle ORM (supporting SQLite, PostgreSQL, and MySQL), key-value storage, file blob storage, and caching. It handles schema definition, migrations, and multi-cloud deployment across Cloudflare, Vercel, Deno, and Netlify with virtual module imports for seamless server-side access.