# Fivetran

Since SnowDDL v0.27, it is possible to natively configure database, user and permissions for Fivetran.

## How to configure Fivetran with SnowDDL?

#### 1) Create custom permission model

Configuration guide for [PERMISSION MODEL](/basic/yaml-configs/permission-model.md)

```yaml
fivetran:
  ruleset: DATABASE_OWNER

  owner_create_grants:
    - STAGE
    - TABLE
    - VIEW

  owner_future_grants:
    STAGE: [OWNERSHIP]
    TABLE: [OWNERSHIP]
    VIEW: [OWNERSHIP]

  read_future_grants:
    STAGE: [READ]
    TABLE: [SELECT, REFERENCES]
    VIEW: [SELECT, REFERENCES]

```

#### 2) Create database

Configuration guide for [DATABASE](/basic/yaml-configs/database.md)

```
is_sandbox: true
permission_model: fivetran
```

#### 3) Create business role

Configuration guide for [BUSINESS ROLE](/basic/yaml-configs/business-role.md)

```
fivetran_owner:
  database_owner:
    - fivetran_db
```

#### 4) Create user

```
ext_fivetran:
  rsa_public_key: ...
  business_roles:
    - fivetran_owner
```

## How to grant access to objects created by Fivetran?

You may grant read access on all objects inside Fivetran database by using `database_read` parameter for [BUSINESS ROLE](/basic/yaml-configs/business-role.md).

For example:

```
fivetran_reader:
  database_read:
    - fivetran_db
```

If you want to provide granular on per-schema basis, it requires a bit more work.

1. Explicitly configure schema(s) in Fivetran database by creating corresponding sub-directories with `params.yaml` files inside.
2. Use parameter `schema_read` for [BUSINESS ROLE](/basic/yaml-configs/business-role.md).

For example:

```
fivetran_specific_reader:
  schema_read:
    - fivetran_db.braintree
    - fivetran_db.paypal
```

SnowDDL can only create "schema roles" for schemas which are explicitly defined in config.


---

# 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.snowddl.com/guides/other-guides/fivetran.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.
