# Dataset Connection

## Databases

MySQL/PostgreSQL, SQL-Server Databases

For MySQL if a port is not specified the default port is 3306\
For PostgreSQL if a port is not specified the default port is 5432\
SQL-Server doesn't require a database port

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/engine/create-dataset/`

#### Headers

| Name                                           | Type | Description      |
| ---------------------------------------------- | ---- | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> |      | application/json |

#### Request Body

| Name                                                   | Type   | Description                                       |
| ------------------------------------------------------ | ------ | ------------------------------------------------- |
| dataset\_name<mark style="color:red;">\*</mark>        | String |                                                   |
| database\_name<mark style="color:red;">\*</mark>       | String |                                                   |
| database\_url<mark style="color:red;">\*</mark>        | String |                                                   |
| server\_type<mark style="color:red;">\*</mark>         | String | can be any of mysql, postgresql, and sql\_server. |
| connection\_type<mark style="color:red;">\*</mark>     |        | database                                          |
| dataset\_description<mark style="color:red;">\*</mark> | String |                                                   |
| database\_user<mark style="color:red;">\*</mark>       | String |                                                   |
| database\_password<mark style="color:red;">\*</mark>   | String |                                                   |
| table\_name<mark style="color:red;">\*</mark>          | String | This is the specific table to be used as dataset  |
| database\_port<mark style="color:red;">\*</mark>       | String |                                                   |

MongoDB Database

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/engine/create-dataset/`

#### Headers

| Name         | Type | Description      |
| ------------ | ---- | ---------------- |
| Content-Type |      | application/json |

#### Request Body

| Name                                                   | Type   | Description                                   |
| ------------------------------------------------------ | ------ | --------------------------------------------- |
| dataset\_name<mark style="color:red;">\*</mark>        | String |                                               |
| database\_url<mark style="color:red;">\*</mark>        | String | This is the MongoDB URI                       |
| server\_type<mark style="color:red;">\*</mark>         | String | mongo                                         |
| connection\_type<mark style="color:red;">\*</mark>     | String | database                                      |
| dataset\_description<mark style="color:red;">\*</mark> | String |                                               |
| table\_name<mark style="color:red;">\*</mark>          | String | This is known as the collection name in mongo |
| database\_name<mark style="color:red;">\*</mark>       | String |                                               |

Oracle DB

<mark style="color:green;">`POST`</mark> `https://api.autogon.ai/api/v1/engine/create-dataset/`

database\_url here refers to the Oracle connection string (connection\_string is of the format hostname/servicename). This is also known as the dsn (data source name). It helps in identifying which database service to connect to.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | String | application/json |

#### Request Body

| Name                                                   | Type   | Description              |
| ------------------------------------------------------ | ------ | ------------------------ |
| dataset\_name<mark style="color:red;">\*</mark>        | String |                          |
| database\_password<mark style="color:red;">\*</mark>   | String |                          |
| database\_user<mark style="color:red;">\*</mark>       | String |                          |
| server\_type<mark style="color:red;">\*</mark>         | String | oracle                   |
| connection\_type<mark style="color:red;">\*</mark>     | String | database                 |
| dataset\_description<mark style="color:red;">\*</mark> | String |                          |
| database\_url<mark style="color:red;">\*</mark>        | String | Oracle connection string |
| table\_name<mark style="color:red;">\*</mark>          | String |                          |
