# `Arcadic.Schema`
[🔗](https://github.com/baselabs/arcadic/blob/baselabs_arcadic-v4.0.1/lib/arcadic/schema.ex#L5)

Read-only introspection of ArcadeDB schema metadata — types, properties, indexes, and
buckets — over the SQL `SELECT FROM schema:*` surface (Cypher does not parse it).

Tenant-blind, like every arcadic module: it reflects the server's metadata rows faithfully.
The `schema:*` selector is arcadic's own fixed literal — no caller value is ever interpolated.
Where a function accepts a caller-supplied type name, that name binds as a `$param` and is
additionally `Arcadic.Identifier`-shape-guarded (value-free). Every returned row is
`@props`-stripped at all nesting depths (ArcadeDB's serializer emits an `@props` count hint on
the row and inside each nested `properties`/`indexes` object).

# `buckets`

```elixir
@spec buckets(Arcadic.Conn.t()) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists the physical buckets (`name`, `fileId`, `records`, `purpose`), `@props`-stripped.

# `buckets!`

```elixir
@spec buckets!(Arcadic.Conn.t()) :: [map()]
```

Lists the physical buckets, returning the rows or raising.

# `database`

```elixir
@spec database(Arcadic.Conn.t()) :: {:ok, map()} | {:error, Exception.t()}
```

Returns the database engine config as a single map — `name`, `path`, `mode`, `dateFormat`,
`dateTimeFormat`, `timezone`, `encoding`, and a `settings` list of `%{"key","value","description",
"overridden","default"}`, `@props`-stripped at every depth. Returns the SINGLE config map.
`SELECT FROM schema:database` is arcadic's own fixed literal (SQL-only) — no caller value interpolated.

# `database!`

```elixir
@spec database!(Arcadic.Conn.t()) :: map()
```

Returns the database config map, or raises.

# `dictionary`

```elixir
@spec dictionary(Arcadic.Conn.t()) :: {:ok, map()} | {:error, Exception.t()}
```

The record dictionary (`schema:dictionary`), `@props`-stripped. Returns the single dictionary map.

# `dictionary!`

```elixir
@spec dictionary!(Arcadic.Conn.t()) :: map()
```

Returns the single dictionary map, or raises.

# `indexes`

```elixir
@spec indexes(Arcadic.Conn.t(), keyword()) ::
  {:ok, [map()]} | {:error, Exception.t() | :invalid_identifier}
```

Lists indexes, `@props`-stripped. Returns BOTH logical indexes (e.g. `Person[name]`, no
`fileId`) AND physical per-bucket indexes (e.g. `Person_0_…`, carrying `fileId`/
`associatedBucketId`) — faithful to `schema:indexes`. A caller wanting only logical indexes
filters on the ABSENCE of the `fileId` key. `opts[:type]` restricts to one type by `typeName`
(`Arcadic.Identifier`-shape-guarded, bound as a `$param`).

# `indexes!`

```elixir
@spec indexes!(Arcadic.Conn.t(), keyword()) :: [map()]
```

Lists indexes, returning them or raising.

# `materialized_views`

```elixir
@spec materialized_views(Arcadic.Conn.t()) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists materialized views (`schema:materializedviews`), each `@props`-stripped.

# `materialized_views!`

```elixir
@spec materialized_views!(Arcadic.Conn.t()) :: [map()]
```

Lists materialized views, or raises.

# `properties`

```elixir
@spec properties(Arcadic.Conn.t(), String.t()) ::
  {:ok, [map()]} | {:error, Exception.t() | :invalid_identifier}
```

Lists the properties of `type` (each with `name`, `type`, `default`, …), `@props`-stripped.
`type` is `Arcadic.Identifier`-shape-guarded (a value-free `{:error, :invalid_identifier}` on a
bad shape — the offending name is never echoed) AND bound as a `$param` — never interpolated.
Returns `{:ok, []}` when the type does not exist (or has no properties); use `types/1` to
distinguish absence from emptiness.

# `properties!`

```elixir
@spec properties!(Arcadic.Conn.t(), String.t()) :: [map()]
```

Lists the properties of `type`, returning them or raising.

# `stats`

```elixir
@spec stats(Arcadic.Conn.t()) :: {:ok, map()} | {:error, Exception.t()}
```

Per-database operation counters (`schema:stats`), `@props`-stripped. Returns the single stats map.

# `stats!`

```elixir
@spec stats!(Arcadic.Conn.t()) :: map()
```

Returns the single stats map, or raises.

# `types`

```elixir
@spec types(Arcadic.Conn.t()) :: {:ok, [map()]} | {:error, Exception.t()}
```

Lists every type (vertex / edge / document). Each row carries `name`, `type`, `records`,
`buckets`, `properties`, `indexes`, and the type's other metadata, `@props`-stripped.

# `types!`

```elixir
@spec types!(Arcadic.Conn.t()) :: [map()]
```

Lists every type, returning the rows or raising.

---

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