Solution Review: Testing in PostgreSQL
Explore how to write unit tests for PostgreSQL databases by using pg_prove for automated testing. Understand how to check the existence of tables and columns with has_table and has_column functions combined with transactional testing in SQL.
We'll cover the following...
We'll cover the following...
Here is the solution for the challenge of writing a test script for unit testing and running your test using pg_prove.
Solution
The tests are written in the respective files. The table required for the challenge is already created for you.
Use the following command to run the tests:
Click the “Run” button in the following ...