# SQL Connector

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2Fq1C4Vp5DSl14oskzJSU8%2Fimage.png?alt=media&#x26;token=b6c84fab-876a-4694-a913-5bf6d8262c94" alt="" width="167"><figcaption></figcaption></figure>

## Actions

The SQL Helper has only one default action - execute SQL.

## Setting up your SQL Helper

#### Connector Auth

To start setting up your connector auth, either go to Settings -> Connector Auth and add a new auth, or add the SQL Helper to a flow and click "Create new Auth".

#### Base Domain

The Base Domain for the SQL Connector Auth has the following schema:

```
{{ Database Driver }}://{{ Host }}/{{ Database }}{{ Additional Driver Details }}
```

Which is built together based on these input fields:

<figure><img src="https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2F7Zf3LkxqzH7haalhZj9h%2Fimage.png?alt=media&#x26;token=5af00279-1bab-4d96-8814-728988344f64" alt="" width="563"><figcaption></figcaption></figure>

In case the database driver and dialect of your database is not listed, please reach out to us. \
Many of the [drivers and dialects listed here](https://docs.sqlalchemy.org/en/14/dialects/) are supported out of the box and we can add them as an option in a few minutes. However, the ones currently not listed, haven't been specifically tested yet and might require additional implementation time from our site.

In most cases, you **will not need a dialect at all**. If you get an error message, try the first listed dialect for your database.

#### Username and Password

In almost all cases, it is advisable to create a separate user for Locoia. To find out how to create a user and manage permissions, please consult your respective database's user guide.

Once you have a user you want to use for DI, simply enter the username and password in these fields.

## Additional instructions for specific dialects

### Amazon RDS

If you need help connecting your DI SQL Helper to Amazon RDS, consult [this article](https://docs.locoia.com/connectors/connectors/aws-rds-database-how-to-connect).

### Oracle

To connect to Oracle, append your service name to the end of the connection string, where you would normally enter the database name (`</database>`).

Known errors and their meanings:

* TNS: listener does not currently know of SID given in the connect descriptor => The database name is not provided correctly. This needs to be added at the end with a slash like above `mysubdatabase`.
* ORA-00900: Invalid SQL statement / Ungültige SQL-Anweisung =>The SQL statement is not correct. Please check your syntax and confirm with the Oracle reference.

### Microsoft SQL Server

For some Microsoft SQL Server connections, you need to enter `?driver=ODBC+Driver+18+for+SQL+Server&TrustServerCertificate=yes` in the **Additional Driver Details** field in order to specify that the database required ODBC Driver 18 in order to connect.
