Fork me on GitHub
#random
<
2019-12-14
Jerreck03:12:57

Looking for a book/video/tutorial/etc on unit testing SQL queries. Google has failed me the last couple days. I keep getting results about testing procs/functions but I’d like to know how test that a query returns an expected set of results in a specific format.

Jerreck03:12:57

Looking for a book/video/tutorial/etc on unit testing SQL queries. Google has failed me the last couple days. I keep getting results about testing procs/functions but I’d like to know how test that a query returns an expected set of results in a specific format.

Michelangelo van Dam22:01:31

Depends on weather you want to test the queries in a database to see if the system returns you the expected values, or if you want to test the SQL query statements as code. If you want to test queries in a database environment, DB-Unit is probably your one-stop integration testing framework (available for multiple languages). If you're seeking to run tests against the scripted SQL statements without integration, I have no clue… I haven't come across a framework that allows SQL to be "unit tested" outside of a database.