logoalt Hacker News

nesarkvechneplast Saturday at 9:32 PM1 replyview on HN

This is exactly what happens in a typical Elixir project even though Ecto is a query builder and not an ORM. People define their domain entities as database tables. The result is, from my latest project, you have user and organisation memberships which are a list of membership records. This is carried throughout the application while it should be a hash map of organisation IDs and membership data, so you can check if a user is a member of an organisation in constant time. Of course keeping ourselves coupled to the database representation is easier than defining a view, for example, which takes care of presenting the data in a useful form for the application.


Replies

vips7Lyesterday at 2:27 PM

That’s a problem with ecto and not ORMs. A good ORM will be able to do that hashmap mapping.

show 1 reply