It's often useful in tests to actually have data in your tables and run functions that query and process the data.

There are two types of test you might need:

Aim to avoid making your tests too "deep" by combining both of these types, as it risks them being fragile.

That said, sometimes end-to-end tests are the best way to check nothing has broken. What if you change the db schema and update the first type but not the second?

One thing I'm struggling with is easily creating a db and loading a schema + data for testing. The ios-api uses a custom testutil package for this, but I don't really want to replicate it!