Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Getting started with Ecto: Fundamentals and overview
Rating: 4.6 out of 5(4 ratings)
49 students
Last updated 1/2024
English

What you'll learn

  • Fundamentals of an Ecto Changeset. Putting changes, differences between `data` and `changes`, having validations, differences from regular structs
  • Fundamentals of an Ecto Migration. Setting up a database, migrating it, adding indices and constraints, uniqueness, UUID primary keys, relations between tables
  • Fundamentals of Ecto Schema. Casting and casting associations, embedded schemas, assocs with UUID as primary key, belongs_to/has_one/has_many/has_many through
  • Fundamentals of Ecto Multi, transactions, locks in them and batch inserting/updating. insert_all/update_all and their limitations
  • Fundamentals of Ecto Query. Querying for `where` conditions, grouping and ordering by fields
  • Creating a context with example functions to Create Read Update Destroy records (CRUD)
  • Fundamentals of testing changesets and functions that operate on database.

Course content

5 sections42 lectures3h 33m total length
  • What you will learn in this course?7:57

    Master Ecto fundamentals by building a simple mix project, learning change sets, validation, and database operations from insert to update, with uuid, has many, embedded schemas, and transactions.

Requirements

  • Basic knowledge of Elixir language

Description

Let me guide you through what is a Changeset: how to cast, put changes, validate, know the differences between `data` and `changes` fields.

Learn about the difference between structs and Changesets.

Let us get into the bridge between Changeset and your database using Phoenix.

Learn about Phoenix generators and let's discuss what do they do.

Learn about migrations, add indices and contstraints, change integer IDs to UUIDs.

Ecto.Schema. Set fields, let's see what are Embedded Schemas by creating embed_one and embeds_many built-in-a-record relations. Associations of all kind (has_one, has_many, has_many through and has_many with UUID as a foreign key),

Learn about the Ecto.Repo. How to insert, update, read from and delete records.

Lean about Ecto.Query. How to compose a query to get the records you want.

Put it all together to a Context module.

Seed the initial data for your application. Set up a script to automatically insert over 50.000 fresh database records.

Learn about bulk operations. Repo.insert_all/update_all and their limitations.

See the power of the Ecto.Multi, database transactions, ensuring data consistency.

Test it all: Changesets, all of the Context.


The course may be followed along, i don't change the code off the camera. Though the suggested way to do the course is to just watch me talk to you very slowly and showing you around what's possible in Ecto. (:

Who this course is for:

  • Beginner Elixir/Phoenix developers who want to have an overview of the functionality of Ecto and what it's capable of