News for hackers. Stuff that matters.
Re:DuckDB – An embeddable SQL database like SQLite, but supp... by jrockway on Sunday September 20, 2020 @12:19AM (#24531862)
I would just create a per-test-file database (and delete it the next time the test runs). The overhead is very small (compared to booting Postgres) and it works exactly like production because it is exactly production.

In general, I am not comfortable using an "almost equivalent" database for tests. Every database engine has its quirks, and if you don't know what they are, your program that passes its tests only "almost" works in production, which is annoying.

Re:DuckDB – An embeddable SQL database like SQLite, but supp... by oauea on Sunday September 20, 2020 @02:30AM (#24532290)
And if you need to run expensive migrations, use a template database.

https://www.postgresql.org/docs/current/manage-ag-templatedb...

Re:DuckDB – An embeddable SQL database like SQLite, but supp... by majodev on Sunday September 20, 2020 @04:08AM (#24532629)
While PostgreSQL templates allow to scaffold new databases (one per test-spec) quite fast, it's even faster to have a warmed up pool of databases ready: https://github.com/allaboutapps/integresql#background

Disclaimer: author.

Re:DuckDB – An embeddable SQL database like SQLite, but supp... by oauea on Sunday September 20, 2020 @04:47PM (#24537286)
Oh that looks great, and very close to what I had in mind for the next upgrade of our in-house testing framework. Definitely going to give that a try soon. Thanks for posting it!