# Connection testing

When you provide connection details for a database server, Structural provides a **Test Connection** button to test the connection. We strongly recommend that you test your database connections.

Structural also runs connection tests when you open an existing workspace and when you start data generation.&#x20;

Structural is currently migrating its data connectors from the legacy connection test to a newer suite of connection tests.

## Legacy connection test

**Used by:** Connectors other than file connector, MySQL, Oracle, PostgreSQL, Snowflake, SQL Server

The legacy connection test verifies whether Structural is able to connect to the database server.

For some data connectors, the legacy connection test also checks whether the database user has sufficient permissions to perform the required Structural tasks.

When you run the legacy connection test, Structural indicates whether the test was successful.

## New connection test suite

**Used by:** File connector, MySQL, Oracle, PostgreSQL, Snowflake, SQL Server

For the new connection test suite, the exact tests vary based on the data connector and the connection role, such as source or destination.

At a high level, the new tests can include:

* **Configuration -** Is the connection configuration valid?
* **Connectivity -** Can Structural connect to the server?
* **Schema queries -** Can Structural retrieve the data schema?
* **Data queries -** Can Structural retrieve the data?
* **Data generation -** Can Structural start and run a data generation job? Can Structural write generated data?

When you run the new connection test suite, Structural:

* Lists the tests that it ran.
* Indicates whether each test was successful.
* For failed tests, the results:
  * Indicate whether the failure is fatal, a warning, or informational.\
    \
    Fatal issues must be resolved. Other types of failures might not block functionality, but might have unexpected side effects.
  * When possible, provide a hint as to how to resolve the failure. You can also use the **Ask AI** option to ask an LLM to troubleshoot the issue and suggest next steps.

## Configuring timeouts for the connection tests

To configure the timeouts for the connection tests, set the following [environment settings](/app/admin/environment-variables-setting.md). You can set these settings from the **Environment Settings** tab on **Structural Settings**.

* `TONIC_TEST_CONNECTION_TIMEOUT_IN_SECONDS` - Used by both the legacy and the new connection tests. The number of seconds before a general connectivity test times out. By default, the connection test times out after 15 seconds.
* `TONIC_DATASOURCE_TEST_TIMEOUT_SECONDS` - Used by the new connection tests only. The number of seconds before an individual test times out. By default, the test times out after 300 seconds.
* `TONIC_DATASOURCE_TEST_SUITE_TIMEOUT_SECONDS` - Used by the new connection tests only. The number of seconds before a connection test suite times out. By default, the suite of tests times out after 600 seconds.

## Testing the connection speed

For the following data connectors, if Structural is able to connect to the database, then it also tests and reports on the connection speed.

* MySQL
* Oracle
* PostgreSQL
* SQL Server


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/workspace/workspace-configuration-settings/data-connection-settings/connection-testing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
