Skip to main content
SQL tests let you write bespoke tests that fit your business circumstances and can be run on any table tracked in the platform through a unified workflow.

Creating a SQL test

  • Head to the Health overview
  • In the SQL tests section, click Add sql test
  • Select the connection to execute your SQL query
  • Specify a SQL query. The test is considered a success if it returns zero records. If any records are returned, the test will trigger an error, and the failed records will be stored in an audit table for investigation. title
  • Choose a schedule (hourly/daily) and a time (hh: mm) when you want the test to run. title
Running an excessive amount of tests or running a test too often will impact your data warehouse costs. Avoid running tests more often than needed
  • The confirmation page will show you a summary of the setup. To make it easier to locate in the UI, you can give the test a human-friendly name. title

Editing a SQL test

  • Head to the Health overview
  • Click on SQL tests to see all your SQL tests
  • Select the SQL test you want to edit by clicking on it
  • In the popout, navigate to the settings tab. Click Edit under SQL test configurations to edit the name, run schedule, or SQL code. To delete the test, click Delete SQL test title

Audit table schema

When a SQL test fails, the failed records are stored in an audit table in your data warehouse for investigation and troubleshooting. The platform automatically creates this table in your data warehouse when you configure a SQL test with saveFailures=true.

Default table name

By default, the audit table is named synq_sql_test__audit. The table location can be configured per integration.

Schema by data warehouse

The audit table schema varies slightly by data warehouse. Below are the CREATE TABLE statements for each supported platform:

Column descriptions

The audit table is created automatically when you run your first SQL test. Ensure the platform has the necessary permissions to create tables in your configured schema or database.