GdaDictTable

GdaDictTable — Represents a table or a view in the database

Functions

Properties

GdaDictDatabase * database Read / Write
gboolean is-view Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GdaObject
        ╰── GdaDictTable

Implemented Interfaces

GdaDictTable implements GdaXmlStorage and GdaEntity.

Description

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

It implements the GdaXmlStorage and GdaEntity interfaces.

Functions

gda_dict_table_new ()

GObject *
gda_dict_table_new (GdaDict *dict);

Creates a new GdaDictTable object

Parameters

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

Parameters

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?

Parameters

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).

Parameters

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.

Parameters

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.

Parameters

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).

Parameters

table

a GdaDictTable object

 

error

location to store error, or NULL

 

Returns

TRUE if no error

Types and Values

GdaDictTable

typedef struct _GdaDictTable GdaDictTable;

Property Details

The “database” property

  “database”                 GdaDictDatabase *

Flags: Read / Write


The “is-view” property

  “is-view”                  gboolean

Flags: Read / Write

Default value: FALSE