> ## Documentation Index
> Fetch the complete documentation index at: https://clisma.poorquality.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

> Common clisma.hcl configurations for local and production

## Local

```hcl theme={null}
env "local" {
  url = "http://default:password@localhost:8123/mydb"

  migrations {
    dir = "migrations"
  }
}
```

## Staging

```hcl theme={null}
env "staging" {
  url = env("CLICKHOUSE_STAGING_URL")

  migrations {
    dir = "migrations"

    vars = {
      replication_factor = 2
      ttl_days = 30
    }
  }
}
```

## Production

```hcl theme={null}
env "production" {
  url = env("CLICKHOUSE_PROD_URL")
  exclude = ["system.*", "_tmp_*"]

  tls {
    ca_file = env("CLICKHOUSE_CA_FILE")
    cert_file = env("CLICKHOUSE_CLIENT_CERT_FILE")
    key_file = env("CLICKHOUSE_CLIENT_KEY_FILE")
  }

  migrations {
    dir = "migrations"

    table {
      name = "schema_migrations"
      is_replicated = true
    }

    vars = {
      replication_factor = var.replication_factor
      ttl_days = 90
    }
  }
}

variable "replication_factor" {
  type = string
  default = "3"
}
```
