Presubmit.Adapters.EctoSchema (presubmit v0.2.2)

Copy Markdown View Source

Models use Ecto.Schema modules.

Recognised shapes: schema "source" do ... end and embedded_schema do ... end containing field, belongs_to, has_one, has_many, many_to_many, embeds_one, embeds_many, and timestamps.

Summary

Functions

Columns the schema's table is expected to have: plain fields (under their source: name if given, and never virtual: true ones) and belongs_to foreign keys.

Names of every field, association, and embed on the schema.

Types

t()

@type t() :: %Presubmit.Adapters.EctoSchema{
  fields: [Presubmit.Adapters.EctoSchema.Field.t()],
  module: module(),
  source: String.t() | nil,
  timestamps?: boolean()
}

Functions

columns(ecto_schema)

@spec columns(t()) :: [atom()]

Columns the schema's table is expected to have: plain fields (under their source: name if given, and never virtual: true ones) and belongs_to foreign keys.

field_names(ecto_schema)

@spec field_names(t()) :: [atom()]

Names of every field, association, and embed on the schema.