Generate XXX schema

phx.gen.schema MODULE_NAME RESOURCEs attribute:value1 attributeN:valueN

Create file in lib/APPNAME/RESOURCEs.ex which define schema

Migrate

mix phx.migrate

Ecto schema

Mapping Elixir values <---> external data source and mapping relationship one schema <---> other schemas

Ecto changesets

Changesets defines a pipeline of transformations.

Transformations: - Casting - Validating - Filtering

External data ---- CHANGESETS ----> ready data.

Persistent

Repo.insert(%Resource{key1:value1, ...})
Repo.one(from s in Student, where: ilike(s.email, "%u%"), select: s.email)
Repo.all(from s in Student, select: %{s.id => s.email})

Context

mix phx.gen.html CONTEXT MODULENAME Resources field1:type1 field2:type2 ...