Re: [gnome-db] Introspection - DataModel structures
- From: "Vivien" <malerba gnome-db org>
- To: "Murray Cumming" <murrayc murrayc com>
- Cc: "gnome-db-list" <gnome-db-list gnome org>
- Subject: Re: [gnome-db] Introspection - DataModel structures
- Date: Fri, 9 Apr 2004 08:50:14 +0200 (CEST)
> I think we are meant to use gda_connection_get_schema() to discover what
> tables exist, and to discover the structure of those tables. But this
> just returns a regular DataModel.
Yes, all the get_shema() returns is a data model.
>
> With postgresql, I find that the first column contains the field name,
> and the 2nd contains the data type [1], but I wonder whether this is
> part of libgda or just a structure that libgda is passing to me directly
> from postgres? Is this documented or standardised? Should I expect to
> get the same structure for every provider?
Yes, the number and type of columns returned for each schema should be the
same for every provider (note that this is not yet the case and some work
needs to be done on some of the providers).
The "format" of each returned data model for each schema is documented in
libgda's doc (such as
http://www.gnome-db.org/docs/libgda/libgda-provider-class.html#LIBGDA-PROVIDER-GET-SCHEMA).
To cope with this problem in libmergeant (which uses get_schema a lot to
build and maintain its dictionnary), I've created some functions which
check that the returned data model in in the right "format" (see the
mg_resultset_check_data_model() in mg-result-set.[ch ]).
Cheers,
Vivien
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]