# `Iceberg.Schema`
[🔗](https://github.com/Ziinc/iceberg-ex/blob/v0.1.0/lib/iceberg/schema.ex#L1)

Builds an Iceberg schema (in the spec's JSON shape) from field tuples.

    Iceberg.Schema.new([
      {"id", :long, required: true},
      {"tags", {:list, :string}},
      {"point", {:struct, [{"x", :double}, {"y", :double}]}}
    ])

Field ids are assigned in order, top-level fields first. Types: `:boolean`,
`:int`, `:long`, `:float`, `:double`, `:date`, `:time`, `:timestamp`,
`:timestamptz`, `:timestamp_ns`, `:timestamptz_ns`, `:string`, `:uuid`,
`:binary`, `{:decimal, precision, scale}`, `{:fixed, length}`,
`{:list, type}`, `{:map, key_type, value_type}` and `{:struct, fields}`.
Field options: `:required` (default `false`) and `:doc`.

# `field`

```elixir
@type field() :: {String.t(), type()} | {String.t(), type(), keyword()}
```

# `type`

```elixir
@type type() :: atom() | tuple()
```

# `new`

```elixir
@spec new([field()]) :: map()
```

---

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