4 ms·
I use an embedded postgres testing library for the JVM that does something along those lines. Well no actually it just unpacks the tar file in a temp dir and r
by switchbak 4y ago
I use an embedded postgres testing library for the JVM that does something along those lines.
Well no actually it just unpacks the tar file in a temp dir and runs the full postgres, but it mostly feels like what you describe (minus the single file part) and starts surprisingly fast. That would totally work for a little proof of concept (https://github.com/zonkyio/embedded-postgres https://github.com/zonkyio/embedded-postgres)
- hot_gril 4y agoThat's pretty neat, but not the same level of portability as SQLite.
- prpl 4y agoI used hypersql/hsqldb for unit tests. The Oracle mode was usually close enough. It’s pretty close for postgres. Sometimes there’s small issues (I think using “INSERT INTO … RETURNING” required column name in caps for some reason) but overall it’s almost always what you want for unit testing with java.
- kitd 4y agoH2db has a Postgres-compatibility mode too that would work for local testing. https://www.h2database.com/html/features.html#compatibility https://www.h2database.com/html/features.html#compatibility