Re: [gnome-db] get_meta_store_data(GDA_CONNECTION_META_FIELDS)





2008/11/30 Johannes Schmid <jhs jsschmid de>
Hi!

I am trying to receive meta data from an sqlite database:

GValue* value = gda_value_new_from_string ("table_name", G_TYPE_STRING);
GdaDataModel* data_model =
gda_connection_get_meta_store_data(connection,
GDA_CONNECTION_META_FIELDS, NULL, 1, "name", value));

But as return a get a data model with columns but zero rows. I couldn't
find any example or test for this in the libgda sources so I am a bit
unsure if I use the API correctly and if this really works.

As retreiving meta data from a database can be a quite lenghty operation, it is done once and all the retreived meta data are stored in a local DB (usually SQLite) accessible through the GdaMetaStore object associated to the connection (this "synchronization" operation needs to be done every time the database's structure changes).

So what you need to do first is call gda_connection_update_meta_store (cnc, NULL, &error). You can also pass a non NULL second argument if you want to update the meta store regarding only a part of it (such as only the meta data regarding a table).

Cheers,

Vivien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]