After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 752145 - Consolidate all the gom_repository_find_*{_sync,_async} functions?
Consolidate all the gom_repository_find_*{_sync,_async} functions?
Status: RESOLVED OBSOLETE
Product: gom
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Gom Maintainers
Gom Maintainers
Depends on:
Blocks: 753379
 
 
Reported: 2015-07-08 21:35 UTC by Mathieu Bridon
Modified: 2019-03-20 10:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mathieu Bridon 2015-07-08 21:35:21 UTC
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.
Comment 1 GNOME Infrastructure Team 2019-03-20 10:39:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gom/issues/16.