## GdaDictTable

GdaDictTable — Represents a table or a view in the database

## Synopsis

                        GdaDictTable;
    GObject*            gda_dict_table_new                  (GdaDict *dict);
    GdaDictDatabase*    gda_dict_table_get_database         (GdaDictTable *table);
    gboolean            gda_dict_table_is_view              (GdaDictTable *table);
    const GSList*       gda_dict_table_get_parents          (GdaDictTable *table);
    GSList*             gda_dict_table_get_constraints      (GdaDictTable *table);
    GdaDictConstraint*  gda_dict_table_get_pk_constraint    (GdaDictTable *table);
    gboolean            gda_dict_table_update_dbms_data     (GdaDictTable *table,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----GdaObject
             +----GdaDictTable

## Implemented Interfaces

GdaDictTable implements GdaXmlStorage and GdaEntity.

## Properties

      "database"                 GdaDictDatabase       : Read / Write
      "is-view"                  gboolean              : Read / Write

## Description

Use this object to query the real structure of the table it represents.

It implements the GdaXmlStorage and GdaEntity interfaces.

## Details

### GdaDictTable

    typedef struct _GdaDictTable GdaDictTable;

### gda_dict_table_new ()

    GObject*            gda_dict_table_new                  (GdaDict *dict);

Creates a new GdaDictTable object

`dict` : | a GdaDict object
Returns : | the new object

### gda_dict_table_get_database ()

    GdaDictDatabase*    gda_dict_table_get_database         (GdaDictTable *table);

Get the database to which the table belongs

`table` : | a GdaDictTable object
Returns : | a GdaDictDatabase pointer

### gda_dict_table_is_view ()

    gboolean            gda_dict_table_is_view              (GdaDictTable *table);

Does the object represent a view rather than a table?

`table` : | a GdaDictTable object
Returns : | TRUE if it is a view

### gda_dict_table_get_parents ()

    const GSList*       gda_dict_table_get_parents          (GdaDictTable *table);

Get the parent tables of the table given as argument. This is significant only for DBMS which support tables inheritance (like PostgreSQL for example).

`table` : | a GdaDictTable object
Returns : | a constant list of GdaDictTable objects

### gda_dict_table_get_constraints ()

    GSList*             gda_dict_table_get_constraints      (GdaDictTable *table);

Get all the constraints which apply to the given table (each constraint can represent a NOT NULL, a primary key or foreign key or a check constraint.

`table` : | a GdaDictTable object
Returns : | a new list of GdaDictConstraint objects

### gda_dict_table_get_pk_constraint ()

    GdaDictConstraint*  gda_dict_table_get_pk_constraint    (GdaDictTable *table);

Get the primary key constraint of `table`, if there is any. If several GdaDictConstraint represent a primary key constraint for `table`, then the first one in the list of constraints is returned.

`table` : | a GdaDictTable object
Returns : | a GdaDictConstraint object or `NULL`.

### gda_dict_table_update_dbms_data ()

    gboolean            gda_dict_table_update_dbms_data     (GdaDictTable *table,
                                                             GError **error);

Synchronises the Table representation with the table structure which is stored in the DBMS. For this operation to succeed, the connection to the DBMS server MUST be opened (using the corresponding GdaConnection object).

`table` : | a GdaDictTable object
`error` : | location to store error, or `NULL`
Returns : | TRUE if no error

## Property Details

### The "`database`" property

      "database"                 GdaDictDatabase       : Read / Write

### The "`is-view`" property

      "is-view"                  gboolean              : Read / Write

Default value: FALSE