Generate XXX schema

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

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


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.


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


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