Ccxt.StructureSchema (CCXT Elixir v0.1.0-binance-pro-preview)

Copy Markdown View Source

Runtime metadata for CCXT unified structure database schemas.

The metadata is read from priv/ccxt_structures/binance_pro_structures.json, the same manifest used to generate the Ecto schema and migration templates. This keeps consuming applications, normalizers, and generated artifacts on the same schema contract without requiring an Ecto dependency here.

Summary

Types

field_entry()

@type field_entry() :: {atom(), field_spec()}

field_spec()

@type field_spec() :: map()

schema_target()

@type schema_target() :: %{
  module_suffix: String.t(),
  table: String.t(),
  unique_identity: boolean(),
  role: :canonical | :history
}

structure()

@type structure() :: atom() | String.t()

Functions

db_field_name(field)

@spec db_field_name(atom() | String.t()) :: atom()

field_entries(structure)

@spec field_entries(structure()) :: {:ok, [field_entry()]} | {:error, term()}

field_entries!(structure)

@spec field_entries!(structure()) :: [field_entry()]

field_spec(structure, field)

@spec field_spec(structure(), atom() | String.t()) ::
  {:ok, field_spec()} | {:error, term()}

fields(structure)

@spec fields(structure()) :: {:ok, [atom()]} | {:error, term()}

manifest()

@spec manifest() :: map()

manifest_path()

@spec manifest_path() :: String.t()

primary_key(structure)

@spec primary_key(structure()) :: {:ok, [atom()]} | {:error, term()}

required_fields(structure)

@spec required_fields(structure()) :: {:ok, [atom()]} | {:error, term()}

schema_targets(structure)

@spec schema_targets(structure()) :: {:ok, [schema_target()]} | {:error, term()}

source_methods(structure)

@spec source_methods(structure()) :: {:ok, [String.t()]} | {:error, term()}

spec(structure)

@spec spec(structure()) :: {:ok, map()} | {:error, {:unknown_structure, String.t()}}

spec!(structure)

@spec spec!(structure()) :: map()

structure_name(structure)

@spec structure_name(structure()) :: String.t()

structures()

@spec structures() :: [String.t()]

table_names()

@spec table_names() :: [String.t()]