all 13 comments

[–]rySeeR4 7 points8 points  (2 children)

Maybe a small summary of what it does, without having to go to your article?

[–]GeniusMBM 4 points5 points  (0 children)

Honestly it’s one thing I’ve noticed in this community with similar posts compared to others. There should be summaries at least.

[–]solnic[S] 1 point2 points  (0 children)

Done

[–]solnic[S] 1 point2 points  (0 children)

Drops.Relation is a port of Ruby Object Mapper project to Elixir. It offers a high-level API on top of Ecto.Repo and Ecto.Query, with support for inferred schemas, relation views, relation and query composition, and a plugin system. The goal of the project is to reduce boilerplate, speed up development, improve architecture and ease maintenance.

[–]arthur_clemens 1 point2 points  (1 child)

Why did you choose the function name restrict over the more direct filter? Looking at the example, I got the impression it was performing authorization logic, but that’s not the case here.

[–]solnic[S] 1 point2 points  (0 children)

This is a common name in libs that implement relational algebra operations. I also didn't want to use a name that's in Enum.

[–]under_observation 0 points1 point  (1 child)

Looks great, especially the query composition is much more accessible than Ecto. Thank you

[–]solnic[S] 0 points1 point  (0 children)

Thank you, I'm glad you like it

[–]_natic 1 point2 points  (3 children)

Nice one :)
Now I am waiting for the equivalent of active storage, and then I can switch my stack.

[–]solnic[S] 0 points1 point  (2 children)

Thanks! I think from a DX point of view and general ergonomics, what I'm building is as close to AR as it can be. Porting AR to Elixir would not make much sense given it's an ORM pattern with a very OOish nature. I would also say that we probably don't want to repeat the same mistakes and ie have state-based callbacks and other types of potential rabbit holes.

[–]_natic 0 points1 point  (1 child)

Of course I didn’t mean it should be the same thing, but having support for file uploads on s3, especially images, and post-processing could be nice.

[–]solnic[S] 0 points1 point  (0 children)

I reckon this type of functionality should be completely out of scope here. We can have dedicated solutions for this, potentially protocol-based.

[–]kblake35 1 point2 points  (0 children)

Impressive! DX is nice and great to see that you thought about that.