View Source Endo.Schema (Endo v0.1.22)
Utility module for discovering Ecto Schema implementations for a given Endo Table
Summary
Functions
Given a list of Endo Tables, tries to load their schemas in their corresponding OTP App.
Functions
@spec load([Endo.Table.t()]) :: [Endo.Table.t()]
@spec load(Endo.Table.t()) :: Endo.Table.t()
Given a list of Endo Tables, tries to load their schemas in their corresponding OTP App.
All Endo Table structs contain metadata about which OTP app a given Repo belongs to. This information is used
to load all Elixir modules that use Ecto.Schema
.
With this list, we match up any schemas to tables that exist; though it is important to note that not all Endo Tables will necessarily have a corresponding Ecto Schema module defined for it.
In this case, the schemas
key of an Endo Table will be an empty list.
It is also possible for multiple Ecto Schemas to exist for a single underlying database tables, thus, any discovered results will be accumulated and returned as a list of modules per Endo Table.