惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
爱范儿
爱范儿
宝玉的分享
宝玉的分享
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
阮一峰的网络日志
阮一峰的网络日志
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
罗磊的独立博客
博客园 - 叶小钗
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
博客园 - 司徒正美
博客园 - 【当耐特】
IT之家
IT之家

Hacker News

Introducing Claude Opus 4.7 GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Bonsai 1-bit WebGPU - a Hugging Face Space by webml-community Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers
PGLite evangelism
Bill Jackson · 2026-04-07 · via Hacker News

Everyone1 loves SQLite, because it’s simple, fast, and in-process, meaning you don’t need a long-lived service running or, *shudders*, Docker Desktop. It’s common for ORMs to work out-of-the-box with SQLite, so you can start fiddling around before getting a proper database set up. It’s also somewhat common/encouraged to use it in tests, where a “real” database isn’t available.

However, this inevitably runs into problems. Production apps generally use Postgres, and subtle differences in the dialect mean that you have to use Postgres in development too, and try to use it in tests as well. Back in the day, this way lay pain, heartache, special poorly-maintained “testing” databases, a workflow for running tests that required two terminal tabs, or indeed the dreaded Docker Desktop.

Thankfully, these days are now behind us because we now have PGLite. PGLite! It’s like SQLite but Postgres! (but only in javascript/WASM, not as a standalone binary like SQLite).

What does that mean exactly? Postgres normally needs a database service permanently running. In development, you will also need two services, either both on your laptop or (more common) the Postgres instance running on a remote server. PGLite is an in-process version of Postgres, meaning you don’t need this second service, you just import ‘pglite’ in code, and you will have a fully-fledged Postgres instance writing to a local file, rather than a separate docker container

Why is this incredibly useful? Primarily for testing! It means you can easily set up tests that read and write to a dummy database, and the point is that it’s exactly the same as the production behaviour. PGLite is literally a standalone build of the same codebase behind proper-Postgres. Example in a Typescript app with Drizzle ORM:

What else is it (potentially) useful for:

  • As a go-to quick-setup database when starting a new project, similar to SQLite. It saves having to do any migration to Postgres later.

  • As an in-browser database, for doing non-trivial data operations on the client. This is actually the use case it was developed for, to plug into the ElectricSQL local-first2 framework.

  • Not crazy, but haven’t tried it: As an actual production database for small apps. This would save a lot of round trips and the cost of hosting a permanent database.

Discussion about this post

Ready for more?