Re: [gnome-db] gda_column_get_primary_key()





2008/11/21 Murray Cumming <murrayc murrayc com>
On Fri, 2008-11-21 at 08:53 +0100, Vivien Malerba wrote:
>
>         Is it normally in the database server, other than in this
>         extra libgda
>         meta data that you store in the database?
>
> It's up to you (as a programmer) to decide how you organize where data
> is stored.

I guess I'm not going to get an answer, or this is your way of saying
"No".

Then I don't understand your question...
 


For instance, the list of fields and their data types _is_ obtainable
from the database server. I just wanted to know if the is-primary-key
property is available in the same way.

Yes. Each field is represented as a GdaMetaTableColumn structure, the is-primary-key property corresponds to the GdaMetaTableColumn.pkey value, or, in case you have a multiple fields PK, then all the PK fields are listed in the GdaMetaTable.pk_cols_array attribute.



In Glom we will probably just store this in our separate Glom::Field
data. There are already other things that libgda (and/or the underlying
database) can't reliably tell us.

If the underlying DB can tell them but Libgda can't then it's possible to improve Libgda...
 


[snip]

>         I guess you use a special table to store that metadata. Is
>         that table
>         name and data format documented somewhere?
>
> There are several tables and views (all starting with an undersore),
> see the description here:
> http://library.gnome.org/devel/libgda/3.99/information_schema.html

Excellent. Thanks. That's reassuring. I assume that you have committed
to some API stability for that structure.

Yes. Other tables or views will probably be added in the future and the current ones migth be extended but the existing fields (and their order) will remain as they are now.
 

You might also want to make it clear when a gda_column_set_*() function
has no actual effect on the database, as seen by a non-libgda
application.

gda_column_set_*() never has any effect on the database. But to make this even clearer, I'll separate the API documentation:
* the gda_column_get*() will remain where they are (client API)
* the gda_column_set*() will go to the section for providers developpers

Vivien
 



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