# SQL Connectors

> Set up SQL database connectors to retrieve data for comparison or evaluation jobs. Each connector requires database credentials, connection details, and optional keys for alignment.

## Overview

SQL (Structured Query Language) connectors enable you to connect to relational databases for data validation. Whether you're using cloud-based solutions, enterprise databases, or open-source options, Data Testing supports comprehensive SQL integration.

{% hint style="info" %}
All SQL connectors support custom SQL queries, pagination controls, and advanced filtering to accommodate your specific validation needs.
{% endhint %}

***

## Available SQL Connectors

{% tabs %}
{% tab title="Cloud Data Warehouses" %}
Modern, scalable cloud-native solutions:

| Connector           | Platform    | Approach                    |
| ------------------- | ----------- | --------------------------- |
| **Amazon Redshift** | AWS         | Column-store data warehouse |
| **Snowflake**       | Multi-Cloud | Elastic cloud data platform |

[Amazon Redshift →](/data-testing/sql-databases/index/redshift.md) [Snowflake →](/data-testing/sql-databases/index/snowflake.md)
{% endtab %}

{% tab title="Enterprise Databases" %}
Industry-standard, battle-tested solutions:

| Connector                | Platform       | Type             |
| ------------------------ | -------------- | ---------------- |
| **Oracle Database**      | Multi-Platform | Enterprise RDBMS |
| **Microsoft SQL Server** | Windows/Cloud  | Enterprise RDBMS |
| **IBM DB2**              | Enterprise     | Enterprise RDBMS |

[Oracle →](/data-testing/sql-databases/index/oracle.md) [SQL Server →](/data-testing/sql-databases/index/mssql.md) [DB2 →](/data-testing/sql-databases/index/db2.md)
{% endtab %}

{% tab title="Open Source" %}
Community-driven, widely-adopted solutions:

| Connector | Platform       | Type              |
| --------- | -------------- | ----------------- |
| **MySQL** | Multi-Platform | Open-source RDBMS |

[MySQL →](/data-testing/sql-databases/index/mysql.md)
{% endtab %}
{% endtabs %}

***

## Common SQL Settings

All SQL connectors share common configuration patterns:

### Connection Parameters

| Parameter         | Description                     | Required |
| ----------------- | ------------------------------- | -------- |
| **Host/Hostname** | Database server address or IP   | ✅ Yes    |
| **Port**          | Database service port           | ✅ Yes    |
| **Database Name** | Specific database to connect to | ✅ Yes    |
| **Username**      | Authentication username         | ✅ Yes    |
| **Password**      | Authentication password         | ✅ Yes    |

### Optional Parameters

| Parameter           | Description                         |
| ------------------- | ----------------------------------- |
| **Schema**          | Specific schema within the database |
| **Connection Pool** | Connection pooling configuration    |
| **Query Timeout**   | Query execution timeout (seconds)   |
| **SSL/TLS**         | Secure connection options           |

***

## SQL Query Configuration

{% hint style="info" %}
Write your SQL queries to:

* Select specific columns you want to validate
* Filter to relevant data with WHERE clauses
* Use consistent ordering for comparisons
* Consider performance with LIMIT clauses
  {% endhint %}

### Example Query Format

```sql
SELECT 
  id,
  customer_name,
  email,
  created_at,
  status
FROM customers
WHERE created_at >= '2024-01-01'
  AND status = 'active'
ORDER BY id ASC
LIMIT 10000;
```

***

## Advanced Features

### Pagination & Limits

Enable pagination controls to handle large datasets efficiently:

* 📊 **Limit** - Restrict number of records retrieved
* 📍 **Offset** - Skip specific number of records
* 🔄 **Batch Processing** - Process data in chunks

{% hint style="success" %}
Perfect for reducing resource usage and validating data in batches.
{% endhint %}

### Alignment Keys

Specify keys for aligning data during comparison jobs:

* Use **Primary Keys** to match records across sources
* Support for **Composite Keys** (multiple columns)
* Automatic key detection available

***

## Connection Best Practices

{% hint style="warning" %}
**Security & Performance:**

1. ✅ Use dedicated read-only database users
2. ✅ Restrict database access by network/IP
3. ✅ Enable TLS/SSL for connections
4. ✅ Rotate credentials regularly
5. ✅ Monitor query performance and resource usage
6. ✅ Keep database statistics up-to-date for optimal planning
   {% endhint %}

***

## Troubleshooting Connection Issues

| Issue                 | Solution                                         |
| --------------------- | ------------------------------------------------ |
| Connection Timeout    | Check host/port, verify firewall rules           |
| Authentication Failed | Verify username/password, check user permissions |
| Query Errors          | Validate SQL syntax, check table/column names    |
| Performance Issues    | Add query limits, optimize WHERE clauses         |

***

## Quick Links

**SQL Connectors:**

* [Amazon Redshift](/data-testing/sql-databases/index/redshift.md) - AWS data warehouse
* [MySQL](/data-testing/sql-databases/index/mysql.md) - Open-source relational database
* [Microsoft SQL Server](/data-testing/sql-databases/index/mssql.md) - Enterprise SQL database
* [IBM DB2](/data-testing/sql-databases/index/db2.md) - Enterprise database system
* [Oracle Database](/data-testing/sql-databases/index/oracle.md) - Industry standard database
* [Snowflake](/data-testing/sql-databases/index/snowflake.md) - Cloud data platform

**Related Topics:**

* [Compare Jobs](/data-testing/jobs-and-workflows/index/compare-job.md)
* [Evaluate Jobs](/data-testing/jobs-and-workflows/index/evaluate-job.md)
* [Data Source Overview](/data-testing/data-sources/index.md)


---

# 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.qyrus.com/data-testing/sql-databases/index.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.
