
Example—An SQL test runs a query to check for rows where the workspace is null. If any rows match the test, it will throw an error
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.

-
Choose a schedule (
hourly/daily) and a time (hh: mm) when you want the test to run.
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 SYNQ UI, you can give the test a human-friendly name.

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
settingstab. ClickEditunder SQL test configurations to edit the name, run schedule, or SQL code. To delete the test, clickDelete SQL test
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. SYNQ automatically creates this table in your data warehouse when you configure a SQL test withsaveFailures=true.
Default table name
By default, the audit table is namedsynq_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:BigQuery
BigQuery
Snowflake
Snowflake
Databricks
Databricks
PostgreSQL
PostgreSQL
Redshift
Redshift
ClickHouse
ClickHouse
Column descriptions
| Column | Description |
|---|---|
integration_id | Unique identifier of the data warehouse integration in SYNQ |
sql_test_path | Path or identifier of the SQL test |
execution_id | Unique identifier for each test execution |
rows_count | Number of rows that failed the test |
result | The failed records in JSON format |
created_at | Timestamp when the audit record was created |
The audit table is created automatically by SYNQ when you run your first SQL test. Ensure SYNQ has the necessary permissions to create tables in your configured schema or database.