Spec-Zone.ru › Phoenix

Ecto.Schema.Metadata

Source

Stores metadata of a struct.

State

The state of the schema is stored in the :state field and allows following values:

  • :built - the struct was constructed in memory and is not persisted to database yet;
  • :loaded - the struct was loaded from database and represents persisted data;
  • :deleted - the struct was deleted and no longer represents persisted data.

Source

The :source tracks the (table or collection) where the struct is or should be persisted to.

Prefix

Tracks the source prefix in the data storage.

Context

The :context field represents additional state some databases require for proper updates of data. It is not used by the built-in adapters of Ecto.Adapters.Postgres and Ecto.Adapters.MySQL.

Schema

The :schema field refers the module name for the schema this metadata belongs to.

Summary

Types

context()
state()
t()
t(schema)

Types

context()Source

@type context() :: any()

state()Source

@type state() :: :built | :loaded | :deleted

t()Source

@type t() :: t(module())

t(schema)Source

@type t(schema) :: %Ecto.Schema.Metadata{
  context: context(),
  prefix: Ecto.Schema.prefix(),
  schema: schema,
  source: Ecto.Schema.source(),
  state: state()
}

Hex Package Hex Preview View llms.txt Download ePub version

Built using ExDoc (v0.40.2) for the Elixir programming language

© 2014 Chris McCord
Licensed under the MIT License.
https://ecto.hexdocs.pm/Ecto.Schema.Metadata.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API