In this article, I show how you can write powerful PostgreSQL tests via Spawn (a CLI), in a way that reduces a lot of boilerplate, uses a single binary (with no extension needed in postgres), and sourcing data for your tests from JSON files. I've been using this to great effect to test complex triggers and functions.