> For the complete documentation index, see [llms.txt](https://docs.sdv.dev/sdv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sdv.dev/sdv/integration/db.md).

# Connect Your Database

{% hint style="info" %}
❖ **SDV Enterprise Bundle**. This feature is available as part of the **AI Connectors Bundle**, an optional add-on to SDV Enterprise. For more information, please visit the [AI Connectors Bundle](/sdv/explore/sdv-bundles/ai-connectors.md) page.
{% endhint %}

We recommend connecting SDV to your database for the smoothest experience. After integration, SDV is automatically able to create metadata based on the database schema and import data to be used for training an SDV synthesizer.

```python
from sdv.io.database import AlloyDBConnector

# 1. Integration: Create a connector and set your config
connector = AlloyDBConnector()
connector.set_import_config('source_db_config.yaml')
connector.set_export_config('destination_db_config.yaml')

# 2. Usage: Use the API create metadata, import training data, and export synthetic data
metadata = connector.create_metadata(table_names=['users', 'transactions', 'sessions'])
data = connector.import_random_subset(metadata=metadata)
...
connector.export(synthetic_data)
```

## ❖ Browse Databases

Use the AI Connectors feature to directly connect to your database and import your data into SDV. Later you can use the same connector to export synthetic data into a new database.

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td align="center">❖ <a href="/sdv/integration/db/integration/alloydb.md"><strong>AlloyDB</strong></a></td><td><a href="/sdv/integration/db/integration/alloydb.md">❖ AlloyDB</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FkJ1bOR4AbOLLD1SkiFzg%2FAlloyDB.png?alt=media&amp;token=cf944e36-a8d7-473f-9938-633d50a770fd">AlloyDB.png</a></td></tr><tr><td align="center">❖<a href="/sdv/integration/db/integration/bigquery.md"> <strong>BigQuery</strong></a></td><td><a href="/sdv/integration/db/integration/bigquery.md">❖ BigQuery</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FuYpWlTYYH1CYOr07wzfG%2FBigQuery.png?alt=media&amp;token=cd7b2e45-cd8b-4132-a06f-5518ce84f829">BigQuery.png</a></td></tr><tr><td align="center">❖ <a href="/sdv/integration/db/integration/mssql.md"><strong>MSSQL</strong></a></td><td><a href="/sdv/integration/db/integration/mssql.md">❖ MSSQL</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FPHBms1a4bQgSdGQKCAoJ%2FMSSQL.png?alt=media&amp;token=a6f2021f-1cfa-4b09-9243-0173db44fc4a">MSSQL.png</a></td></tr><tr><td align="center">❖ <a href="/sdv/integration/db/integration/oracle.md"><strong>Oracle</strong></a></td><td><a href="/sdv/integration/db/integration/oracle.md">❖ Oracle</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FZfj0JCHAUEh35s1qaTsk%2FOracle.png?alt=media&amp;token=a8ba5d36-54ef-476c-9557-86a6ecf676f8">Oracle.png</a></td></tr><tr><td align="center">❖ <a href="/sdv/integration/db/integration/postgresql.md"><strong>PostgreSQL</strong></a></td><td><a href="/sdv/integration/db/integration/postgresql.md">❖ PostgreSQL</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FaoQYOyetcdahpAvL3aAS%2FPostgreSQL.png?alt=media&amp;token=4ad8e042-3ffd-4af7-98b4-584ac6191884">PostgreSQL.png</a></td></tr><tr><td align="center">❖ <a href="/sdv/integration/db/integration/spanner.md"><strong>Spanner</strong></a></td><td><a href="/sdv/integration/db/integration/spanner.md">❖ Spanner</a></td><td><a href="https://1967107441-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfNxEeZzl9uFiJ4Zf4BRZ%2Fuploads%2FYlYJaZhTyVM24IriuOns%2FSpanner.png?alt=media&amp;token=6f0a8473-7699-42fa-9783-358ee372bedf">Spanner.png</a></td></tr></tbody></table>

{% hint style="success" %}
**Request additional databases.** If your database provider is not covered by the list above, please [leave us a request](https://forum.datacebo.com/). If approved our team is able to add a connector for a relational database in a few weeks.&#x20;

*We prioritize requests made by customers who are using AI Connectors.*
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sdv.dev/sdv/integration/db.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
