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 575754 - gda_config_list_providers() should not return a GdaDataModel
gda_config_list_providers() should not return a GdaDataModel
Status: RESOLVED OBSOLETE
Product: libgda
Classification: Other
Component: Client library
3.99.x
Other Linux
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-17 20:54 UTC by Murray Cumming
Modified: 2018-09-21 13:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2009-03-17 20:54:11 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.
Comment 1 malerba 2009-03-17 21:23:07 UTC
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).
Comment 2 Murray Cumming 2009-03-17 21:27:48 UTC
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.
Comment 3 malerba 2009-03-17 21:33:38 UTC
What makes you think the data model is freeform?
Comment 4 Murray Cumming 2009-03-17 21:38:30 UTC
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.
Comment 5 malerba 2009-03-18 07:56:30 UTC
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?
Comment 6 Murray Cumming 2009-03-18 10:57:09 UTC
Thanks, that sounds better.

I don't like gda_config_list_dsn() returning a GdaDataModel either, now that you mention it.
Comment 7 GNOME Infrastructure Team 2018-09-21 13:39:21 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/libgda/issues/41.