# `Fivetrex.Models.Schema`
[🔗](https://github.com/lostbean/fivetrex/blob/v0.2.3/lib/fivetrex/models/schema_config.ex#L100)

Represents a database schema within a connector's schema configuration.

A schema is a namespace containing tables. In some databases (e.g., PostgreSQL),
this maps directly to database schemas. In others (e.g., MySQL), it may represent
a database name.

## Fields

  * `:name_in_destination` - The name used in the destination warehouse
    (may differ from source due to Fivetran naming rules)
  * `:enabled` - Whether this schema is being synced
  * `:tables` - Map of table name to `Fivetrex.Models.Table` structs

## Examples

    # Check if a schema is enabled
    if schema.enabled do
      IO.puts("Syncing schema: #{schema.name_in_destination}")
    end

    # Get all enabled tables
    enabled_tables =
      schema.tables
      |> Enum.filter(fn {_name, table} -> table.enabled end)
      |> Map.new()

# `t`

```elixir
@type t() :: %Fivetrex.Models.Schema{
  enabled: boolean() | nil,
  name_in_destination: String.t() | nil,
  tables: %{required(String.t()) =&gt; Fivetrex.Models.Table.t()} | nil
}
```

A Fivetran Schema struct.

All fields may be `nil` if not provided in the API response.

# `from_map`

```elixir
@spec from_map(map()) :: t()
```

Converts a map (from JSON response) to a Schema struct.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
