You have a .sql file that contains the query and then the response is next AS SQL COMMENTS. The test runner runs the query and verifies that it matches the (comment-delimiter stripped) comment immediately following the query.
Your .sql can contain database creation, inserts, you name it.
Then you run them as part of your CI infrastructure.
See https://docs.rs/txtar/latest/txtar/ for an example
andersmurphy•6mo ago
- [1] https://blog.janestreet.com/the-joy-of-expect-tests/
jacobobryant•6mo ago