Consolidate all the gom_repository_find_*{_sync,_async} functions?
@mbridon
Submitted by Mathieu Bridon Link to original bug (#752145)
Description
We currently have several functions to fetch resources from the database:
- gom_repository_find_sync (GomRepository *repository, GType resource_type, GomFilter *filter, GError **error);
- gom_repository_find_sorted_sync (GomRepository *repository, GType resource_type, GomFilter *filter, GomSorting *sorting, GError **error);
- gom_repository_find_async (GomRepository *repository, GType resource_type, GomFilter *filter, GAsyncReadyCallback callback, gpointer user_data);
- gom_repository_find_sorted_async (GomRepository *repository, GType resource_type, GomFilter *filter, GomSorting *sorting, GAsyncReadyCallback callback, gpointer user_data);
It's not a great API to have to use one or the other, depending on whether you want to sort or not.
Eventually we'll have things like GROUP BY or HAVING, for which we'd add yet more functions?
Maybe at some point, we should just break the API and keep only the gom_repository_find_sync and the gom_repository_find_async functions, and just have them get all the parameters?
The filters and sorting arguments are NULL-able already anyway, so one function taking them all would work for cases where the user doesn't want one of them.
This ticket is just here on Bastien's request, to keep track of this idea, so that if we ever break the API at some point for some reason, we could do this one as well at the same time.