![]() Left_join: er in assoc(f, :event_runners), That said I trying to use the current ecto query: event_query = from e in Event, limit: ^max_rows The idea is to limit only the FROM part of the query, returning the correct amount of events stopping the results from the JOINs interfering with the limit count, as it would occur if I used a LIMIT clause in the main query, as there is multiple event_runners for one event, defined as a has_many in the Event schema. LEFT JOIN event_runner as er ON e.id = er.event_id If you would like to read more articles about Elixir, be sure to follow us on Twitter or Dev.I’m trying to replicate the following PostgreSQL query with ecto: SELECT *įROM (SELECT * FROM event LIMIT 1000) as e If Thinking in Ecto was not enough and you would like to see another conference talk by Darin Wilson, this one is a bit more in-depth. It’s curated by Dashbit, the company working on Elixir. A cookbook with recipes on how to achieve common Ecto tasks. ![]() Elixir School’s Ecto section contains a lot of useful info and code examples on changesets and queries. It’s well written and should be able to answer most of your questions. This is a rather large YouTube playlist of 13 videos that goes through some of the basics of Ecto. I’m a fan of the content Alchemist Camp is putting out, and this is no different.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |