🌲 alog (Append-only Log) is an easy way to start using the Lambda/Kappa architecture in your Elixir/Phoenix Apps while still using PostgreSQL (with Ecto).
The get_by function is returning old values of an entry if they match the clauses passed in and the most recent one does not. We need to check that the item being returned is the most recent, else we should return nil.
We can do this by performing a get call on the item's entry id once we have it, then comparing the results to make sure they match. This will add an extra query though, so it would be better to add this check to the original query. If anybody has time to make this improvement, please do.
The
get_by
function is returning old values of an entry if they match the clauses passed in and the most recent one does not. We need to check that the item being returned is the most recent, else we should return nil.We can do this by performing a
get
call on the item's entry id once we have it, then comparing the results to make sure they match. This will add an extra query though, so it would be better to add this check to the original query. If anybody has time to make this improvement, please do.