3 ms·
FWIW I used to use https://pgtap.org https://pgtap.org for a short while but then switched to 'invariant testing' (my word for it) where I basically write DDL f
by DemocracyFTW2 10mo ago
FWIW I used to use https://pgtap.org https://pgtap.org for a short while but then switched to 'invariant testing' (my word for it) where I basically write DDL for views that collect rows that don't look like I expect them to look like.
I since moved to SQLite in NodeJS and one of the things I just implemented is views that look at strategic points in the DB—where data is ingested—and tests whether all text fields are Unicode-normalized; for this I can use the JS `String::normalize()` method I previously didn't even know of. Stuff like this makes me easily forget the many advanced feautures of PostgreSQL and forgive SQLite its quirks because the overall experience is that much more enjoyable. And, to answer directly: I can write unit tests for SQL in the same file and using the same code that I use for all my unit tests. Yay!