{"slug": "pglite", "name": "PGlite", "category": "databases", "category_name": "Databases", "description": "PostgreSQL compiled to WebAssembly, running in the browser, Node.js, and other JS runtimes.", "recommenders": 5, "commenters": 7, "warners": 1, "score": 3.758, "rising": -1.64, "first": "2025-12-04", "latest": "2026-06-23", "why": "HN commenters like it for running a real Postgres in memory or in the browser, without Docker or a running server, especially for tests and local development.", "why_is_quote": false, "has_verdict": true, "sentiment": {"recommend": 5, "neutral": 1, "compare": 0, "warn": 1}, "spark": [0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0], "listed": true, "loved": ["No server needed", "In-browser Postgres"], "caveat": "Single connection", "short_quote": "I use pglite for unit/integration tests and it's been fantastic.", "icon": true, "domain": null, "github_repo": null, "official_url": "https://pglite.dev", "pricing": "open source", "aliases": ["PGlite", "pglite", "PGLite"], "verdict": [{"text": "HN commenters like it for running a real Postgres in memory or in the browser", "cites": [{"id": 778349570, "item_id": 48646848, "url": "https://news.ycombinator.com/item?id=48646848", "by": "ilbert", "date": "2026-06-23", "stance": "recommend", "quote": "I use an in-memory Postgres (PGLite) to describe the queries", "excerpt": "I actually took a lot of inspiration from sqlx, which is really nice. The main differences are: - in JS/TS you don't have compile-time scripts that you can run like with Rust's macros, so you need to run a codegen command before running the type checks (disadvantage) - I had to create a TS parser that goes and finds the tagged template functions with the sql statements, while sqlx has them \"for free\" because sql stat", "context": "", "use_case": "describing SQL queries in-memory", "switched_from": "", "story": "Show HN: Bun-sqlgen \u2013 Type-safe raw SQL for Bun, no ORM"}, {"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}, {"id": 738382112, "item_id": 46148882, "url": "https://news.ycombinator.com/item?id=46148882", "by": "buremba", "date": "2025-12-04", "stance": "recommend", "quote": "PGlite is fantastic.", "excerpt": "PGlite is fantastic. I use it for my in-browser PostgreSQL server for development. It implements the PG protocol on the server; when clients connect, we forward queries to the user's browser, which runs PGlite under the hood. The result is a PG server that fully lives in your browser: https://dbfor.dev", "context": "", "use_case": "in-browser PostgreSQL for development", "switched_from": "", "story": "PGlite \u2013 Embeddable Postgres"}]}, {"text": ", without Docker or a running server, especially for tests and local development.", "cites": [{"id": 763614144, "item_id": 47725884, "url": "https://news.ycombinator.com/item?id=47725884", "by": "yathern", "date": "2026-04-10", "stance": "recommend", "quote": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic!", "excerpt": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic! Loved how speedily I could have a \"real\" postgres instance without spinning up docker. Worked really really well with pnpm workspaces and a monorepo setup (EG pnpm run will run the DB package, as well as frontend and backend). The only downside (and this applies for SQLite as well) is that it runs too well that you can get some bad habits - or", "context": "", "use_case": "local dev Postgres", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 778349570, "item_id": 48646848, "url": "https://news.ycombinator.com/item?id=48646848", "by": "ilbert", "date": "2026-06-23", "stance": "recommend", "quote": "I use an in-memory Postgres (PGLite) to describe the queries", "excerpt": "I actually took a lot of inspiration from sqlx, which is really nice. The main differences are: - in JS/TS you don't have compile-time scripts that you can run like with Rust's macros, so you need to run a codegen command before running the type checks (disadvantage) - I had to create a TS parser that goes and finds the tagged template functions with the sql statements, while sqlx has them \"for free\" because sql stat", "context": "", "use_case": "describing SQL queries in-memory", "switched_from": "", "story": "Show HN: Bun-sqlgen \u2013 Type-safe raw SQL for Bun, no ORM"}]}, {"text": " The most common caveat is that it runs in single-user mode with one connection at a time", "cites": [{"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}]}, {"text": ", and some extensions such as PostGIS are not supported.", "cites": [{"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}]}], "praise": [{"label": "No server needed", "summary": "Gives a real Postgres instance without Docker or a running pg server.", "quotes": [{"id": 763614144, "item_id": 47725884, "url": "https://news.ycombinator.com/item?id=47725884", "by": "yathern", "date": "2026-04-10", "stance": "recommend", "quote": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic!", "excerpt": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic! Loved how speedily I could have a \"real\" postgres instance without spinning up docker. Worked really really well with pnpm workspaces and a monorepo setup (EG pnpm run will run the DB package, as well as frontend and backend). The only downside (and this applies for SQLite as well) is that it runs too well that you can get some bad habits - or", "context": "", "use_case": "local dev Postgres", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 778349570, "item_id": 48646848, "url": "https://news.ycombinator.com/item?id=48646848", "by": "ilbert", "date": "2026-06-23", "stance": "recommend", "quote": "I use an in-memory Postgres (PGLite) to describe the queries", "excerpt": "I actually took a lot of inspiration from sqlx, which is really nice. The main differences are: - in JS/TS you don't have compile-time scripts that you can run like with Rust's macros, so you need to run a codegen command before running the type checks (disadvantage) - I had to create a TS parser that goes and finds the tagged template functions with the sql statements, while sqlx has them \"for free\" because sql stat", "context": "", "use_case": "describing SQL queries in-memory", "switched_from": "", "story": "Show HN: Bun-sqlgen \u2013 Type-safe raw SQL for Bun, no ORM"}, {"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}]}, {"label": "In-browser Postgres", "summary": "Runs Postgres directly in the user's browser via WASM.", "quotes": [{"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}, {"id": 738382112, "item_id": 46148882, "url": "https://news.ycombinator.com/item?id=46148882", "by": "buremba", "date": "2025-12-04", "stance": "recommend", "quote": "PGlite is fantastic.", "excerpt": "PGlite is fantastic. I use it for my in-browser PostgreSQL server for development. It implements the PG protocol on the server; when clients connect, we forward queries to the user's browser, which runs PGlite under the hood. The result is a PG server that fully lives in your browser: https://dbfor.dev", "context": "", "use_case": "in-browser PostgreSQL for development", "switched_from": "", "story": "PGlite \u2013 Embeddable Postgres"}, {"id": 757623745, "item_id": 47351484, "url": "https://news.ycombinator.com/item?id=47351484", "by": "BERTmackliin", "date": "2026-03-12", "stance": "neutral", "quote": "PGlite (PostgreSQL in WASM) lets it run anywhere Node.js does", "excerpt": "I built Anchor because I kept hitting the same wall: local LLMs are great, but every conversation is a fresh start. Vector search is the default hammer, but for structured memory\u2014project decisions, entity relationships, temporal facts\u2014it's often the wrong tool. Live demo (in-browser, no setup): https://rsbalchii.github.io/anchor-engine-node/demo/index.html Search Moby Dick or Frankenstein and see the tag-based receip", "context": "", "use_case": "embedded database", "switched_from": "", "story": "Anchor Engine \u2013 deterministic semantic memory for LLMs, <1GB RAM runs on a phone"}]}, {"label": "Works reliably", "summary": "Users describe it as fantastic and working fine for most purposes.", "quotes": [{"id": 763614144, "item_id": 47725884, "url": "https://news.ycombinator.com/item?id=47725884", "by": "yathern", "date": "2026-04-10", "stance": "recommend", "quote": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic!", "excerpt": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic! Loved how speedily I could have a \"real\" postgres instance without spinning up docker. Worked really really well with pnpm workspaces and a monorepo setup (EG pnpm run will run the DB package, as well as frontend and backend). The only downside (and this applies for SQLite as well) is that it runs too well that you can get some bad habits - or", "context": "", "use_case": "local dev Postgres", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}, {"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}]}], "caveats": [{"label": "Single connection", "summary": "Single-user mode allows only one connection, so no concurrent transactions.", "quotes": [{"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}]}, {"label": "Limited extensions", "summary": "Not all Postgres extensions are supported, notably PostGIS, though pgvector works.", "quotes": [{"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}]}, {"label": "Heavy footprint", "summary": "One user found it too heavy for a browser project and switched to SQLite.", "quotes": [{"id": 738345696, "item_id": 46146606, "url": "https://news.ycombinator.com/item?id=46146606", "by": "adhamsalama", "date": "2025-12-04", "stance": "warn", "quote": "I found it a bit heavy so I used SQLite instead.", "excerpt": "I tried to use this when I was building a project about peer-to-peer database sharing in the browser using WebAssembly and WebRTC, but I found it a bit heavy so I used SQLite instead. Here's the project if anyone is interested: https://github.com/adhamsalama/sqlite-wasm-webrtc", "context": "", "use_case": "in-browser database", "switched_from": "", "story": "PGlite \u2013 Embeddable Postgres"}]}, {"label": "Scaling habits", "summary": "Running so easily locally can encourage patterns that don't scale horizontally in production.", "quotes": [{"id": 763614144, "item_id": 47725884, "url": "https://news.ycombinator.com/item?id=47725884", "by": "yathern", "date": "2026-04-10", "stance": "recommend", "quote": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic!", "excerpt": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic! Loved how speedily I could have a \"real\" postgres instance without spinning up docker. Worked really really well with pnpm workspaces and a monorepo setup (EG pnpm run will run the DB package, as well as frontend and backend). The only downside (and this applies for SQLite as well) is that it runs too well that you can get some bad habits - or", "context": "", "use_case": "local dev Postgres", "switched_from": "", "story": "PGLite Evangelism"}]}], "who": [], "tags": ["for testing", "for local development", "for browser apps", "for monorepos"], "use_cases": ["describing sql queries in-memory", "unit/integration tests", "local dev postgres", "embedded database", "postgres running in user's browser", "in-browser postgresql for development"], "compared": [{"slug": "sqlite", "name": "SQLite", "co": 3, "switched_from": 0, "switched_to": 1}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=47703805", "title": "PGLite Evangelism", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=46146133", "title": "PGlite \u2013 Embeddable Postgres", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=48645390", "title": "Show HN: Bun-sqlgen \u2013 Type-safe raw SQL for Bun, no ORM", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=47351483", "title": "Anchor Engine \u2013 deterministic semantic memory for LLMs, <1GB RAM runs on a phone", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46336947", "title": "Go ahead, self-host Postgres", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {"warn": 1, "recommend": 2}, "2026-01": {}, "2026-02": {}, "2026-03": {"neutral": 1}, "2026-04": {"recommend": 2}, "2026-05": {}, "2026-06": {"recommend": 1}, "2026-07": {}, "2026-08": {}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 778349570, "item_id": 48646848, "url": "https://news.ycombinator.com/item?id=48646848", "by": "ilbert", "date": "2026-06-23", "stance": "recommend", "quote": "I use an in-memory Postgres (PGLite) to describe the queries", "excerpt": "I actually took a lot of inspiration from sqlx, which is really nice. The main differences are: - in JS/TS you don't have compile-time scripts that you can run like with Rust's macros, so you need to run a codegen command before running the type checks (disadvantage) - I had to create a TS parser that goes and finds the tagged template functions with the sql statements, while sqlx has them \"for free\" because sql stat", "context": "", "use_case": "describing SQL queries in-memory", "switched_from": "", "story": "Show HN: Bun-sqlgen \u2013 Type-safe raw SQL for Bun, no ORM"}, {"id": 763652192, "item_id": 47728262, "url": "https://news.ycombinator.com/item?id=47728262", "by": "jwilliams", "date": "2026-04-11", "stance": "recommend", "quote": "I use pglite for unit/integration tests and it's been fantastic.", "excerpt": "I use pglite for unit/integration tests and it's been fantastic. Note that it uses \"single user mode.\" This means a single connection at a time, and thus no concurrent transactions. That takes you a little bit closer to SQLite's single-writer.", "context": "", "use_case": "unit/integration tests", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 763614144, "item_id": 47725884, "url": "https://news.ycombinator.com/item?id=47725884", "by": "yathern", "date": "2026-04-10", "stance": "recommend", "quote": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic!", "excerpt": "I used PGLite for a project (monkeys.zip) and it was absolutely fantastic! Loved how speedily I could have a \"real\" postgres instance without spinning up docker. Worked really really well with pnpm workspaces and a monorepo setup (EG pnpm run will run the DB package, as well as frontend and backend). The only downside (and this applies for SQLite as well) is that it runs too well that you can get some bad habits - or", "context": "", "use_case": "local dev Postgres", "switched_from": "", "story": "PGLite Evangelism"}, {"id": 757623745, "item_id": 47351484, "url": "https://news.ycombinator.com/item?id=47351484", "by": "BERTmackliin", "date": "2026-03-12", "stance": "neutral", "quote": "PGlite (PostgreSQL in WASM) lets it run anywhere Node.js does", "excerpt": "I built Anchor because I kept hitting the same wall: local LLMs are great, but every conversation is a fresh start. Vector search is the default hammer, but for structured memory\u2014project decisions, entity relationships, temporal facts\u2014it's often the wrong tool. Live demo (in-browser, no setup): https://rsbalchii.github.io/anchor-engine-node/demo/index.html Search Moby Dick or Frankenstein and see the tag-based receip", "context": "", "use_case": "embedded database", "switched_from": "", "story": "Anchor Engine \u2013 deterministic semantic memory for LLMs, <1GB RAM runs on a phone"}, {"id": 741421232, "item_id": 46338827, "url": "https://news.ycombinator.com/item?id=46338827", "by": "ishandotpage", "date": "2025-12-20", "stance": "recommend", "quote": "For most purposes, it works perfectly fine", "excerpt": "`pglite` is a WASM version of postgres. I use it in one of my side projects for providing a postgres DB running in the user's browser. For most purposes, it works perfectly fine, but with two main caveats: 1. It is single user, single connection (i.e. no MVCC) 2. It doesn't support all postgres extensions (particularly postGIS), though it does support pgvector https://github.com/supabase-community/pg-gateway is somet", "context": "", "use_case": "Postgres running in user's browser", "switched_from": "", "story": "Go ahead, self-host Postgres"}, {"id": 738382112, "item_id": 46148882, "url": "https://news.ycombinator.com/item?id=46148882", "by": "buremba", "date": "2025-12-04", "stance": "recommend", "quote": "PGlite is fantastic.", "excerpt": "PGlite is fantastic. I use it for my in-browser PostgreSQL server for development. It implements the PG protocol on the server; when clients connect, we forward queries to the user's browser, which runs PGlite under the hood. The result is a PG server that fully lives in your browser: https://dbfor.dev", "context": "", "use_case": "in-browser PostgreSQL for development", "switched_from": "", "story": "PGlite \u2013 Embeddable Postgres"}, {"id": 738345696, "item_id": 46146606, "url": "https://news.ycombinator.com/item?id=46146606", "by": "adhamsalama", "date": "2025-12-04", "stance": "warn", "quote": "I found it a bit heavy so I used SQLite instead.", "excerpt": "I tried to use this when I was building a project about peer-to-peer database sharing in the browser using WebAssembly and WebRTC, but I found it a bit heavy so I used SQLite instead. Here's the project if anyone is interested: https://github.com/adhamsalama/sqlite-wasm-webrtc", "context": "", "use_case": "in-browser database", "switched_from": "", "story": "PGlite \u2013 Embeddable Postgres"}]}