Arcadic.Schema (Arcadic v0.7.1)

Copy Markdown View Source

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).

Summary

Functions

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

Lists the physical buckets, returning the rows or raising.

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.

Returns the database config map, or raises.

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

Returns the single dictionary map, or raises.

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).

Lists indexes, returning them or raising.

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

Lists materialized views, or raises.

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.

Lists the properties of type, returning them or raising.

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

Returns the single stats map, or raises.

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

Lists every type, returning the rows or raising.

Functions

buckets(conn)

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

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

buckets!(conn)

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

Lists the physical buckets, returning the rows or raising.

database(conn)

@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!(conn)

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

Returns the database config map, or raises.

dictionary(conn)

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

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

dictionary!(conn)

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

Returns the single dictionary map, or raises.

indexes(conn, opts \\ [])

@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!(conn, opts \\ [])

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

Lists indexes, returning them or raising.

materialized_views(conn)

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

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

materialized_views!(conn)

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

Lists materialized views, or raises.

properties(conn, type)

@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!(conn, type)

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

Lists the properties of type, returning them or raising.

stats(conn)

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

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

stats!(conn)

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

Returns the single stats map, or raises.

types(conn)

@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!(conn)

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

Lists every type, returning the rows or raising.