GNOME Bugzilla – Bug 575754
gda_config_list_providers() should not return a GdaDataModel
Last modified: 2018-09-21 13:39:21 UTC
It's too late to change this for libgda-4.0 now, but maybe it can be corrected in a future API. gda_config_list_providers() returns a GdaDataModel of only vaguely defined structure: http://library.gnome.org/devel/libgda/unstable/libgda-40-Configuration.html#gda-config-list-providers That's an arbitrary and strange thing to return. Not everything must be a DataModel. The previous explicit API was much clearer and more robust.
What's wrong with returning a data model as long as the data returned is composed of rows and columns? However the doc can be more explicit by mentionning each column's type (string) and position (0, 1, etc).
Because there's zero need for it to be so freeform. Just because something can be used despite the difficulty doesn't mean that it's a good API.
What makes you think the data model is freeform?
Surely you know what I mean. An explicit API with functions such as get_provider_name(GdaProviderInfo*) or get_provider_names(config) would be much more obvious. You are just using GdaDataModel because libgda deals with databases, but this part of the libgda API does not need to present its result like a database.
I see your point. The reason I chose to return a data model was to be homogenous with the gda_config_list_dsn() which also returns a data model (this returned data model gets updated with added/removed DSN which is a feature a simple list can't offer). Here is what I propose: * improve the gda_config_list_providers() doc as mentionned * create a gda_config_get_providers_list() which returns a new list of GdaProviderInfo pointers. How does it sound?
Thanks, that sounds better. I don't like gda_config_list_dsn() returning a GdaDataModel either, now that you mention it.
-- 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/libgda/issues/41.