# Configrutions

### Database Configuration <a href="#database-configuration" id="database-configuration"></a>

Datasherlock offers support for all major databases. Choose the database type that suits your application's requirements and configure it accordingly.

Configuration:

{% tabs %}
{% tab title="MySQL" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "mysql"
database:
  host: "<DB_HOST>"
  username: "<DB_USERNAME>"
  port: "<DB_PORT>"
  database: "<DB_NAME>"
  ssl: "<DB_SSL>" 
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `host` : Your database host URL
* `username` : Your Database Username
* `port` : Your Database Password, default 3306
* `database` : "Your Database name"
* `ssl` : "SSL is enabled or disable (true, false)"
  {% endtab %}

{% tab title="PostgresSQL" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "postgres"
database:
  host: "<DB_HOST>"
  username: "<DB_USERNAME>"
  port: "<DB_PORT>"
  database: "<DB_NAME>"
  ssl: "<DB_SSL>" 
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `host` : Your database host URL
* `username` : Your Database Username
* `port` : Your Database Password, default 5432
* `database` : "Your Database name"
* `ssl` : "SSL is enabled or disable (enable, disable)"
  {% endtab %}

{% tab title="BigQuery" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "bigquery"
database:
  database: "<DB_NAME>"
  project_id: "<GCP_PROJECT_ID>" 
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `database` : "Your Database name"
* `project_id` : GCP Project id
  {% endtab %}

{% tab title="SnowFlake" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "snowflake"
database:
  database: "<DB_NAME>"
  username: "<SNOWFLAKE_USERNAME>"
  account: "<SNOW_FLAKE_ACCOUNT>"
  warehouse: "<SNOW_FLAKE_WAREHOUSE>"
  schema: "<SNOW_FLAKE_SCHEMA>"
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `database` : "Your Database name"
* `account` : "Only used for snowflake account"
* `warehouse` : "Only used for snowflake warehouse"
* `schema` : "Only used for snowflake schema name"
* `username` : Your Database Username
  {% endtab %}

{% tab title="MsSQL" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "mssql"
database:
  host: "<DB_HOST>"
  username: "<DB_USERNAME>"
  port: "<DB_PORT>"
  database: "<DB_NAME>"
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `host` : Your database host URL
* `username` : Your Database Username
* `port` : Your Database Password, default 3306
* `database` : "Your Database name"
  {% endtab %}

{% tab title="Redshift" %}

### Configuration <a href="#configuration-options" id="configuration-options"></a>

```
type: "redshift"
database:
  host: "<DB_HOST>"
  username: "<DB_USERNAME>"
  port: "<DB_PORT>"
  database: "<DB_NAME>"
  ssl: "<DB_SSL>" 
```

### Configuration Options <a href="#configuration-options" id="configuration-options"></a>

* `host` : Your database host URL
* `username` : Your Database Username
* `port` : Your Database Password, default 443
* `database` : "Your Database name"
  {% endtab %}
  {% endtabs %}

### Single Sign-On (SSO) Configuration <a href="#single-sign-on-sso-configuration" id="single-sign-on-sso-configuration"></a>

Integrate Single Sign-On (SSO) functionality into Datasherlock using the following configuration parameters:

Configure your chosen SSO, such as OKTA or Google. Here's an example with Google Cloud Console:

* Create an OAuth client ID in your Google Cloud project (e.g., API Console) - choose "Web application" type.
* Set your app's origins and redirect URLs: where Google can send users after login.
* Grab your client ID and client secret: store them securely, they're your keys to Google SSO.

**Redirect URL:**

* For Local Testing

```yaml
http://127.0.0.1:8080/authorization-code/callback
```

* For Production Deployment

```yaml
Remote_URL/authorization-code/callback
```

<figure><img src="https://3853050875-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP205EUdPJUmuNBngqIWg%2Fuploads%2FXoVCfyoUqMPrnWyZ77yJ%2Fimage.png?alt=media&#x26;token=9063888e-b194-4204-92ca-199cc9b69cb2" alt=""><figcaption></figcaption></figure>

NOTE: Get the **Remote\_URL** from the dashboard.&#x20;

Update the Sherlock configuration file with these parameters:

{% tabs %}
{% tab title="Google" %}
\
Extend Sherlock config by adding oauth field:

<pre><code><strong>type: &#x3C;DB_TYPE>
</strong><strong>database:
</strong>  ....
oauth:  
  client_id: "client_id"
  scopes: ["openid", "profile", "email"]
  provider: "https://accounts.google.com"
</code></pre>

{% endtab %}

{% tab title="Github" %}

```
oauth:  
  client_id: "client_id"
  scopes: ["openid", "profile", "email"]
  provider: "provider_url"
```

{% endtab %}
{% endtabs %}

Replace the **client\_id** given by your Auth provider.

Also add the **client\_secret** provided by the Auth Provider, as an environment variable.

```yaml
export CLIENT_SECRET="client_secret"
```

With these configurations in place, Datasherlock can seamlessly connect to your chosen database and offer SSO support for your application.

Use the following command to register an agent with the Datasherlock cloud. It will provide you with a token and a remote link. Make sure to keep these credentials secure.


---

# 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://datasherlock.gitbook.io/datasherlock/introductions/configrutions.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.
