I wanted to use soft delete for my project. I found a nice library called paranoid, it was working only with ecto 2, I managed to upgrade it, however the behavior of preloads are the default ones from Ecto. I was reading the source code from Ecto preload, however it has few to no commentaries and it is kind of hard to understand. The basic idea I thought of implementing is appending a query that checks for is_nil(deleted_at), however queries can be nested so this proves a challenge.
Currently the only way to achieve this is to make a query inside the preload, witch is not the perfect case, especially when preload is used in a query itself.
Here is the preload implementation: https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/repo/preloader.ex
Here is the repository I forked and updated to ecto3: https://github.com/D4no0/paranoid
At least some basic help, like how nested preloads work would be appreciated.