- eBook:Programming Ecto: Build Database Apps in Elixir for Scalability and Performance
- Author:Darin Wilson, Eric Meadows-Jonsson
- Edition:1 edition
- Data:April 11, 2019
- Pages:244 pages
- Format:PDF, ePUB
Elixir and Phoenix are taking the application development world by storm, and Ecto, the database library that ships with Phoenix, is going right along with them. There are plenty of examples that show you the basics, but to use Ecto to its full potential, you need to learn the library from the ground up.
This definitive guide starts with a tour of the core features of Ecto - repos, queries, schemas, changesets, transactions - gradually building your knowledge with tasks of ever-increasing complexity. Along the way, you'll be learning by doing - a sample application handles all the boilerplate so you can focus on getting Ecto into your fingers.
Build on that core knowledge with a series of recipes featuring more advanced topics. Change your pooling strategy to maximize your database's efficiency. Use nested associations to handle complex table relationships. Add streams to handle large result sets with ease. Based on questions from Ecto users, these recipes cover the most common situations developers run into.
Whether you're new to Ecto, or already have an app in production, this title will give you a deeper understanding of how Ecto works, and help make your database code cleaner and more efficient.
What You Need:
To follow along with the book, you should have Erlang/OTP 19+ and Elixir 1.4+ installed. The book will guide you through setting up a sample application that integrates Ecto.
1. Getting Started with Repo
2. Querying Your Database
3. Connecting Your Tables to Elixir Structs with Schemas
4. Making Changes with Changesets
5. Making Multiple Changes with Transactions and Multi
6. Making Changes to Your Database
Part II. Ecto Applied
7. Adding Ecto to an Elixir Application Without Phoenix
8. Working with Changesets and Phoenix Forms
9. Testing with Sandboxes
10. Creating and Using Custom Types
11. Inserting and Updating with Upserts
12. Optimizing Your Application Design
13. Working with Embedded Schemas
14. Creating Polymorphic Associations
15. Optimizing IEx for Ecto
16. Using Schemas Without Tables
17. Tuning for Performance