News for hackers. Stuff that matters.
Re:Database mocks are just not worth it by smackeyacky on Monday December 30, 2024 @04:14PM (#42553614)
You can just simply run postgres, why bother with pglite?

postgres installs easily on WSL2 or whatever Linux distribution you're using.

Re:Database mocks are just not worth it by fweimer on Monday December 30, 2024 @06:07PM (#42554618)
You don't even need to install it. It doesn't take a lot of code to run initdb to create a temporary instance, write a suitable configuration file, launch the postmaster process, and delete the temporary database directory tree after terminating the database after testing is complete. On a not-too-fast Linux system, the time for all that is around half a second. Too much overhead for individual unit tests, but fast enough to run once per test suite run.
Re:Database mocks are just not worth it by rikthevik on Monday December 30, 2024 @09:56PM (#42555960)
Agreed. Running docker-compose and postgres-alpine works just fine.