# Quick start guide for Snowplow dbt packages
> Quick start guides for setting up and running Snowplow dbt packages including database privileges and package installation steps.
> Source: https://docs.snowplow.io/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-quickstart/
> Documentation index: https://docs.snowplow.io/llms.txt

The following pages contain the steps to get you up and running with our packages. For more detailed information on running the packages see the [individual package pages](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-models/), and the [configuration](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/) pages.

## Database Privileges

In addition to the standard [privileges required by dbt](https://docs.getdbt.com/faqs/warehouse/database-privileges), our packages by default write to additional schemas beyond just your profile schema. If your connected user does not have `create schema` privileges, you will need to ensure that the following schemas exist in your warehouse and the user can create tables in them:

- `<profile_schema>_derived`
- `<profile_schema>_scratch`
- `<profile_schema>_snowplow_manifest`

Alternatively, you can override the output schemas our models write to, see the relevant package [configuration page](/docs/modeling-your-data/modeling-your-data-with-dbt/dbt-configuration/) for how to do this.

**Snowflake:**

```sql
  grant create schema on database <database_name> to role <role_name>;

   --alternatively
   create schema <profile_schema>_derived;
   create schema <profile_schema>_scratch;
   create schema <profile_schema>_manifest;
   grant usage on schema <profile_schema>_derived to role <role_name>;
   grant usage on schema <profile_schema>_scratch to role <role_name>;
   grant usage on schema <profile_schema>_manifest to role <role_name>;
```

For more information, please refer to the [Official Guide](https://docs.snowflake.com/en/sql-reference/sql/grant-privilege) on setting up permissions.

**BigQuery:**

Please refer to the [Official Guide](https://cloud.google.com/bigquery/docs/access-control) on setting up permissions.

**Databricks:**

```sql
   -- user with "use catalog" privilege on the catalog
  grant create schema on catalog <catalog_name> to <principal_name>

   --alternatively
   create schema <profile_schema>_derived;
   create schema <profile_schema>_scratch;
   create schema <profile_schema>_manifest;
   grant usage on schema <profile_schema>_derived to <user_name>;
   grant usage on schema <profile_schema>_scratch to <user_name>;
   grant usage on schema <profile_schema>_manifest to <user_name>;
```

For more options (e.g.: granting to service principal, or group instead of users), please refer to the [Official Guide](https://docs.databricks.com/en/sql/language-manual/security-grant.html) on setting up permissions.

**Redshift:**

```sql
   -- someone with superuser access
   create schema authorization <user_name>;

   --alternatively
   create schema <profile_schema>_derived;
   create schema <profile_schema>_scratch;
   create schema <profile_schema>_manifest;
   grant usage on schema <profile_schema>_derived to <user_name>;
   grant usage on schema <profile_schema>_scratch to <user_name>;
   grant usage on schema <profile_schema>_manifest to <user_name>;
```

For more options (e.g.: granting to role, or group instead of users), please refer to the [Official Guide](https://docs.aws.amazon.com/redshift/latest/dg/r_GRANT.html) on setting up permissions.

**Postgres:**

```sql
   -- someone with superuser access
   create schema authorization <user_name>;

   --alternatively
   create schema <profile_schema>_derived;
   create schema <profile_schema>_scratch;
   create schema <profile_schema>_manifest;
   grant usage on schema <profile_schema>_derived to <user_name>;
   grant usage on schema <profile_schema>_scratch to <user_name>;
   grant usage on schema <profile_schema>_manifest to <user_name>;
```

For more information, please refer to the [Official Guide](https://www.postgresql.org/docs/current/sql-createschema.html) on setting up permissions.

***

## Mixing Variables

> **Tip:** When using multiple dbt packages you must be careful to specify which scope a variable or configuration is defined within. In general, always specify each value in your `dbt_project.yml` nested under the specific package e.g.
>
> ```yml
> vars:
>   snowplow_web:
>     snowplow__atomic_schema: schema_with_snowplow_web_events
>   snowplow_mobile:
>     snowplow__atomic_schema: schema_with_snowplow_mobile_events
> ```
>
> You can read more about variable scoping in dbt's docs around [variable precedence](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/using-variables#variable-precedence).
