Testing Your Database
You can use the Supabase CLI to test your database. The minimum required version of the CLI is v1.11.4. To get started:
- Install the Supabase CLI on your local machine
Creating a test#
Create a tests folder inside the supabase folder:
Create a new file with the .sql
extension which will contain the test.
Writing tests#
All sql
files use pgTAP as the test runner.
Let's write a simple test to check that our auth.users
table has an ID column. Open hello_world.test.sql
and add the following code:
Running tests#
To run the test, you can use:
This will produce the following output: