Re: [gnome-db] gda_column_get_primary_key()





2008/12/21 Murray Cumming <murrayc murrayc com>
On Fri, 2008-11-21 at 10:20 +0100, Vivien Malerba wrote:
> 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.

So why can't this be a simple get/set function on GdaColumn,
http://library.gnome.org/devel/libgda/unstable/GdaColumn.html

like it was in libgda-3.0?
http://library.gnome.org/devel/libgda/stable/GdaColumn.html#gda-column-get-primary-key

When inspecting the properties of a table, you don't always have a GdaColumn. Moreover when you have a GdaDataModel (resulting from executing a SELECT), then the Primary key attribute of a column can lead to mis interpretations (for example it could mean that the column could be considered as a PK for the data in the data model, or it could be that the corresponding column was effectively part of a PK constraint). So basically one had to run a "SELECT * FROM table" to reliably get the PK columns of a table which is not a good wy of proceeding.

Vivien



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