Hi @brunohkbx. Thanks for the PR. I don't think a limit option makes sense for this function, except for when you pass render_struct: false. However, if you only need the version entries, it's simpler to just write the desired query yourself:
query = from v in MyApp.Version,
where: v.entity_id == ^id,
where: v.entity_schema == ^struct,
order_by: [desc: v.recorded_at],
limit: 5
MyApp.Repo.all(query)
Maybe it also makes sense if we have a utility function that generates that query for you from a given struct, to which you could then add further modifications such as limit, maybe like this:
Hi @brunohkbx. Thanks for the PR. I don't think a limit option makes sense for this function, except for when you pass
render_struct: false
. However, if you only need the version entries, it's simpler to just write the desired query yourself:Maybe it also makes sense if we have a utility function that generates that query for you from a given struct, to which you could then add further modifications such as limit, maybe like this: