GdaDdlTable

GdaDdlTable — Object to represent table database object

Stability Level

Stable, unless otherwise indicated

Properties

gchar * comment Read / Write
gchar * istemp Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GdaDdlBase
        ╰── GdaDdlTable

Implemented Interfaces

GdaDdlTable implements GdaDdlBuildable.

Includes

#include <libgda/libgda.h>

Description

This object represents a table of a database. The table view can be constracted manually using API or generated from xml file together with other databse objects. See GdaDdlCreator. GdaDdlTable implements GdaDdlBuildable interface for parsing xml file.

Functions

gda_ddl_table_error_quark ()

GQuark
gda_ddl_table_error_quark (void);

gda_ddl_table_new ()

GdaDdlTable *
gda_ddl_table_new (void);

Returns

New instance of GdaDdlTable. Use gda_ddl_table_free() to delete the object and free the memory.


gda_ddl_table_free ()

void
gda_ddl_table_free (GdaDdlTable *self);

A convenient method to free free the object

Parameters

self

a GdaDdlTable object

 

Since: 6.0


gda_ddl_table_is_valid ()

gboolean
gda_ddl_table_is_valid (GdaDdlTable *self);

gda_ddl_table_get_columns ()

const GList *
gda_ddl_table_get_columns (GdaDdlTable *self);

Use this method to obtain internal list of all columns. The internal list should not be freed.

Parameters

self

an GdaDdlTable object

 

Returns

A list of GdaDdlColumn objects or NULL if the internal list is not set or if NULL is passed.

[element-type Gda.DdlColumn][transfer none]

Since: 6.0


gda_ddl_table_get_fkeys ()

const GList *
gda_ddl_table_get_fkeys (GdaDdlTable *self);

Use this method to obtain internal list of all fkeys. The internal list should not be freed.

Parameters

self

A GdaDdlTable object

 

Returns

A list of GdaDdlFkey objects or NULL if the internal list is not set or NULL is passed.

[element-type Gda.DdlFkey]

Since: 6.0


gda_ddl_table_append_column ()

void
gda_ddl_table_append_column (GdaDdlTable *self,
                             GdaDdlColumn *column);

Append column to the internal list of columns

Parameters

self

a GdaDdlTable instance

 

column

column to add

 

Since: 6.0


gda_ddl_table_is_temp ()

gboolean
gda_ddl_table_is_temp (GdaDdlTable *self);

Checks if the table is temporary

Parameters

self

a GdaDdlTable object

 

Returns

TRUE if table is temporary, FALSE otherwise.

Since: 6.0


gda_ddl_table_set_temp ()

void
gda_ddl_table_set_temp (GdaDdlTable *self,
                        gboolean istemp);

Set if the table should be temporary or not. False is set by default.

Parameters

self

a GdaDdlTable object

 

istemp

Set if the table should be temporary

 

Since: 6.0


gda_ddl_table_prepare_create ()

gboolean
gda_ddl_table_prepare_create (GdaDdlTable *self,
                              GdaServerOperation *op,
                              GError **error);

Populate op with information stored in self . This method sets op to execute CREATE_TABLE operation.

Parameters

self

a GdaDdlTable instance

 

op

an instance of GdaServerOperation to populate.

 

error

error container

 

Since: 6.0


gda_ddl_table_update ()

gboolean
gda_ddl_table_update (GdaDdlTable *self,
                      GdaMetaTable *obj,
                      GdaConnection *cnc,
                      GError **error);

With this method object obj in the database available through cnc will be updated using ADD_COLUMN operation with information stored in self .

Parameters

self

a GdaDdlTable instance

 

obj

The corresponding meta object to take data from

 

cnc

opened connection

 

error

error container

 

Returns

TRUE if no error and FALSE otherwise


gda_ddl_table_create ()

gboolean
gda_ddl_table_create (GdaDdlTable *self,
                      GdaConnection *cnc,
                      GError **error);

Execute a full set of steps to create tabe in the database. This method is called with "IFNOTEXISTS" option.

Parameters

self

a GdaDdlTable object

 

cnc

a GdaConnection object

 

error

container for error storage

 

Returns

TRUE if successful, FALSE otherwise

Since: 6.0


gda_ddl_table_new_from_meta ()

GdaDdlTable *
gda_ddl_table_new_from_meta (GdaMetaDbObject *obj);

Create new GdaDdlTable instance from the corresponding GdaMetaDbObject object. If NULL is passed this function works exactly as gda_ddl_table_new()

Parameters

obj

a GdaMetaDbObject

 

Returns

New object that should be freed with gda_ddl_table_free()

Since: 6.0


gda_ddl_table_append_fkey ()

void
gda_ddl_table_append_fkey (GdaDdlTable *self,
                           GdaDdlFkey *fkey);

Append fkey to the internal list of columns

Parameters

self

a GdaDdlTable instance

 

fkey

fkry to add

 

Since: 6.0

Types and Values

GDA_TYPE_DDL_TABLE

#define GDA_TYPE_DDL_TABLE (gda_ddl_table_get_type())

struct GdaDdlTableClass

struct GdaDdlTableClass {
    GdaDdlBaseClass parent_class;
};

enum GdaDdlTableError

Members

GDA_DDL_TABLE_COLUMN_EMPTY

Table doesn't contain columns

 

GDA_DDL_TABLE_ERROR

#define GDA_DDL_TABLE_ERROR gda_ddl_table_error_quark()

GdaDdlTable

typedef struct _GdaDdlTable GdaDdlTable;

Property Details

The “comment” property

  “comment”                  gchar *

Table comment.

Flags: Read / Write

Default value: NULL


The “istemp” property

  “istemp”                   gchar *

Is table temporary.

Flags: Read / Write

Default value: NULL