|
|
|
|
|
by victorbjorklund
25 days ago
|
|
The thing is that in Ecto, everything is structured around the actual underlying data. Rather than some abstract objects and stuff like that. query =
from u in User,
where: u.age > 18 Repo.all(query) And there is no magic (At least very little). For example, if you wanna access something that is in another table, for example, you're on a user and you wanna access their posts in many frameworks, if you try to read their posts, they would be automatically loaded from the database but in Ecto, you need to explicitly preload them. That avoids accidental and n+1 problems because you can plan your queries more. You're not gonna trigger a lot of queries without realizing it. |
|