GNOME Bugzilla – Bug 572393
gda_connection_open_from_string should create connections strings transparently
Last modified: 2018-09-21 13:38:43 UTC
gda_connection_open_from_string is well documented, however it misses few important points: when using SQLite provider you have to pass DB_DIR key and TNSNAME one when you use Oracle provider. Also GDA3 expects 'USER' key while GDA4 expects 'USERNAME'. I expect any application which provides abstract database access based on GDA, "abuses" own code with many conditional control blocks which could be implemented (and encapsulated) by GDA itself. Other information:
You mean Libgda should provide a way for testing if the connection parameters passed in a connection string are valid (all required are present, there is no incoherence between them, ...)?
Well... two cases: 1. I couldn't connect to Oracle DB, and I found out that TNSNAME has been missed in connection string. The others parameters stays the same for Oracle ,so for such case, gda could add TNSNAME transparently. 2. I couldn't connect to MySQL DB using GDA4. Just because GDA4 expects USERNAME while GDA3 expects USER. It's a little annoying. I thought about generic structure which could be used to open connection with (in case when you do not use gda' xml configuration). Main point is, that's so easy to make mistake while handling data which could be handled transparently by GDA.
Note that the gda_connection_open_from_string() documentation http://developer.gnome.org/libgda/unstable/GdaConnection.html#gda-connection-open-from-string mentions that gda_config_get_provider_info() can tell you what authentication parameters are possible: http://developer.gnome.org/libgda/unstable/libgda-5.0-Configuration.html#gda-config-get-provider-info though a) That does not document what the meaning of each parameter is, or whether it is _required_. b) I wish that they were just listed right there in the API documentation. I have no idea what TNSNAME means, or if it can be abstracted. I guess we need that list of all the parameters so we can start to think about how they can be unified. > GDA4 expects USERNAME while GDA3 expects USER. Well, that's a different issue (of backwards compatibility).
-- 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/38.