News for hackers. Stuff that matters.
Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by bezbac on Monday August 12, 2024 @11:26AM (#41225523)
I recently experimented with using pglite for API integration tests in one of my side projects. It worked pretty well and has much better DX than using something like testcontainers[0] to spin up postgres running in docker.

[0]: https://testcontainers.com

Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by samwillis on Monday August 12, 2024 @12:12PM (#41226107)
I see unit and integration testing as a massive opportunity for PGlite. I know of projects (such as Drizzle ORM) that are already make good use of it.

The team at Supabase have built pg-gateway (https://github.com/supabase-community/pg-gateway) that let you connect to PGlite from any Postgres client. That's absolutely a way you could use it for CI.

One thing I would love to explore (or maybe commenting it here will inspire someone else) is a copy on write page level VFS for PGLite. I could imagine starting and loading a PGlite with a dataset and then instantly forking a database for each test. Not complexities with devcontainers or using Postgres template databases. Sub ms forks of a database for each test.

Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by riverdroid on Monday August 12, 2024 @11:51AM (#41225840)
I would also love to use it this way in Go. Currently we dump SQLite compatible schema to use for SQLite powered integration tests even though we use postgres when live. It allows us to have zero dependency sub-second integration tests using a real database. Being able to use postgres would be even better, allowing us to test functionality requiring PG specific functionality like full text search.
Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by FlyingSnake on Monday August 12, 2024 @12:05PM (#41226025)
I'm bothering the PGLite team a lot to help us enable this :-)

We have different options like embedded-postgres or integreSQL, but none match the simplicity of PGLite. I hope this wish comes true soon.

https://github.com/fergusstrange/embedded-postgres/tree/mast...

https://github.com/allaboutapps/integresql

Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by koeng on Monday August 12, 2024 @01:54PM (#41227363)
Re:Show HN: PGlite – in-browser WASM Postgres with pgvector ... by koeng on Monday August 12, 2024 @12:04PM (#41226012)
I do exactly the same thing. I’m even running SQLite in wasm so I don’t have any C dependencies. Switching out for Postgres would be awesome