Log In
0% completed
All Lessons
Free Lessons (9)
Introduction to This Course
Why Ecto?
Course Plan
Part I: Ecto Fundamentals
Overview of Part I
Get Started with Repo
Ecto and Elixir
Characteristics of Ecto
Ecto Modules
Set Up the Sample Application
Running the Examples
Data Model of the Sample Application
The Repository Pattern
The Repo Module
Put Our Repo to Work
Get Values Back
Execute Queries
Customize Your Repo
Wrapping Up: Get Started with Repo
Exercise: Customize Your Repo Module
Solution: Customize Your Repo Module
Quiz: Get Started with Repo
Query Your Database
Introduction to the Query Module
Query Basics
Refine Our Results with the Where Expression
Protect Against SQL Injection
Dynamic Values and Their Types
Query Bindings
Insert Raw SQL
Combine Results with union and union_all Options
Order and Group
Work With Joins
Why Use the Composing Queries
Named Bindings
Compose Queries with Functions
Combine Queries with or_where
Other Ways to Use Queries
Wrapping Up: Query Your Database
Exercise: Create Queries in Ecto
Solution: Create Queries in Ecto
Quiz: Query Your Database
Connect Tables to Elixir Structs with Schemas
Introduction to Schemas
Create Schemas
How to Write Queries with Schemas
Insert with Schemas
Delete with Schemas
Add Associations to Schemas
Many-to-Many Associations
Work with Associations in Queries
Optimize Associations With Embedded Schemas
Delete Records With Associations
Use Schemas to Seed a Database
Wrapping Up: Connect Tables to Elixir Structs with Schemas
Exercise: Create Schemas in Ecto
Solution: Create Schemas in Ecto
Quiz: Connect Tables to Elixir Structs with Schema
Make Changes with Changesets
Introduction to Changesets
Cast and Filter
Validate Your Data
Work with Constraints
Capture Errors
Use Changesets Without Schemas
Work with Associations
Associations Using Internal Data
Associations Using External Data
Update Records with Associations
Best Practices for Associations
Wrapping Up: Make Changes with Changesets
Exercise: Create Changesets in Ecto
Solution: Create Changesets in Ecto
Quiz: Make Changes with Changesets
Make Multiple Changes with Transactions and the Multi Module
Introduction to Transactions and the Multi Module
Run Transactions with Functions
Force a Rollback Within a Transaction
Execute Non-Database Operations Within a Transaction
Drawbacks of Using Functions
Run Transactions and Capturing Errors with Ecto.Multi
Optimize Multi with Changesets
Execute Non-Database Operations with Multi
Wrapping Up: Make Multiple Changes with Transactions
Exercise: Work with Transactions and the Multi Module
Solution: Work with Transactions and the Multi Module
Quiz: Make Multiple Changes
Make Changes to the Database
What are Migrations?
Your First Migration
Run Migrations
Add Indexes
Change Data and Table Structure Simultaneously
Specify Up and Down Operations
Change Default Behaviors
Change Timestamps
Run Migrations Outside of a Transaction
Wrapping Up: Make Changes to Your Database
Exercise: Create Migrations
Solution: Create Migrations
Quiz: Make Changes to your Database
Part II: Ecto Applied
Overview of Part II
Add Ecto to an Elixir Application Without Phoenix
Ecto in Elixir Applications: An Introduction
Create a New Project
Create Your Repo Module
Add Ecto to the Supervision Tree
Use Multiple Ecto Repos
Start Your App
Wrapping Up: Add Ecto to an Elixir Application Without Phoenix
Quiz: Add Ecto to an App without Phoenix
Work with Changesets and Phoenix Forms
Ecto and Phoenix Forms: An Introduction
Generate a Form for a Single Schema
Display Changeset Errors
Create a Form with an Association
Create a Form with Multiple Associations
Wrapping Up: Work Changesets and Phoenix Forms
Quiz: Work with Changesets and Phoenix Forms
Test with Sandboxes
Introduction to Sandboxes
Set Up an Async Test
Change the Ownership Mode
Safely Share Connections with Allowances
Wrapping Up: Test with Sandboxes
Quiz: Test with Sandboxes
Create and Use Custom Types
Introduction to Custom Types in Ecto
Building on Top of Ecto’s Types
Adding Custom Types Without the Built-In Types
Wrapping Up: Creating and Using Custom Types
Quiz: Creating and Using Custom Types
Inserting and Updating with Upserts
Introduction to Upserts
Perform Upserts Without Schemas
Perform Upserts with Schemas
Wrapping Up: Insert and Update with Upserts
Exercise: Use Ecto's Upsert Feature
Solution: Use Ecto's Upsert Feature
Quiz: Insert and Update with Upserts
Optimizeing Your Application Design
Introduction to Optimized Application Design
Separate the Pure Code from the Impure Code
Work with Context
Work with Umbrella Applications
Wrapping Up: Optimize Your Application Design
Quiz: Optimize Your Application Design
Work with Embedded Schemas
Introduction to Embedded Schemas
Create Embedded Schemas
Make Changes
Choose Between Embedded Schemas and Associations
Wrapping Up: Work with Embedded Schemas
Quiz: Work with Embedded Schemas
Creating Polymorphic Associations
Introduction to Polymorphic Associations
Polymorphism in Other Frameworks
Approach #1: Multiple Foreign Keys
Approach #2: Use an Abstract Schema
Approach #3: Use many_to_many
Wrapping Up: Create Polymorphic Associations
Quiz: Creating Polymorphic Associations
Optimize IEx for Ecto
Introduction to Optimizing IEx for Ecto
Add Imports and Aliases
Add Helper Functions
Wrapping Up: Optimize IEx for Ecto
Quiz: Optimize IEx for Ecto
Use Schemas Without Tables
Introduction to Schemas Without Tables
Schemas and Tables
Create Table-less Schemas
Save the Table-less Structs
Wrapping Up: Use Schemas Without Tables
Quiz: Use Schemas Without Tables
Tune for Performance
Introduction to Performance Tuning
Optimization
Execute Bulk Operations
Fetch Large Datasets With Streams
Wrapping Up: Tune for Performance
Quiz: Tune for Performance
Conclusion
Closing Thoughts
Building Database Applications in Elixir with Ecto
/
...
/
Introduction to Embedded Schemas
Introduction to Embedded Schemas
Learn about embedded schemas.
We'll cover the following...
Embedded Schemas
What we’ll learn
Embedded Schemas
Embedded
...