2009/7/17 Bas Driessen <[email protected]>

>  On Fri, 2009-07-17 at 14:08 +0200, Vivien Malerba wrote:
>
>
>
>  2009/7/17 Bas Driessen <[email protected]>
>
>  Hello,
>
> Question regarding meta store. There is a function to update the meta store
> as follows:
>
> gda_connection_update_meta_store
>
> When I run this, it waits about 10 seconds or so, so I assume it is
> building the meta store. However, when it is finished, I don't see any
> output. I would expect files to show up in etc/libgda-4.0, but nothing is
> added there. Is there meant to be any output?
>
> Also if this generates a structure in memory only, does that mean that I
> have to call this function every time when I start my application?
>
> My understanding was, that the meta store was written to an XML file and
> that the libgda would reference that. Only when a table layout has changed,
> you would run the gda_connection_update_meta_store function to update the
> XML files.
>
>
> Meta data storage has changed since V3. In V3, getting the meta data was
> quicker and created an XML file which was loaded in memory even if unused.
> There were problems with that approach:
> * it used memory even when not required
> * not much meta data was being fetched (which is why it was so fast), the
> main missing feature was that database schemas were not handled.
> * the loading time would have increased and the consummed memory as well if
> I had added the missing meta data
> * it was almost impossible to the API used to add some personnal data to
> the dictionary.
>
> So in V4:
> * the meta data is now stored in a database instead of an XML file
> * the data is not loaded in main memory if not needed
> * the meta data being fetched now includes schemas, triggers, ...
> * the database used to store meta data from a connection can be configured,
> see
> http://library.gnome.org/devel/libgda/stable/gda-dict.html#GdaMetaStoreSetup.
> By default a temporary database is created, destroyed when the connection is
> closed (more exactly when the GdaMetaStore object associated to the
> connection is destroyed).
>
> it's up to the user to handle the meta data updates, probably one time to
> get the complete meta data the first time, and then incremental updates when
> database objects are created or removed. This is what Libgda's tools (the
> gda-sql console program and the upcomming gda-browser UI program) do: then
> create an SQLite database to store meta data in $HOME/.local/share/libgda
>
>  Thanks Vivien. So if I use a postgresql database, will the meta data be
> stored in a postgresql table? If so where is it, as I can not see it in the
> psql command line tool.
>

It's up to you to decide where you want the meta data to be stored:
* it will be by default in a temporary SQLite database which is not what you
want
* it can be stored in your PostgreSQL database along with your data
* it can be in a separate SQLite file


>
> In order to cache, I need to prevent that this meta data is removed upon
> exiting my application, correct? Is that all explained of how to do that in
> the link you sent me?  Well, I probably better read it first :)
>

There some sample code there, and you can then have a look at the
gda-sql.c's code.

Vivien
_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list

Reply via email to