## MgServerDataType

MgServerDataType — Represents a data type in the DBMS

## Synopsis

    struct      MgServerDataType;
    struct      MgServerDataTypePrivate;
    guint       mg_server_data_type_get_type    (void);
    GObject*    mg_server_data_type_new         (MgServer *srv);
    void        mg_server_data_type_set_sqlname (MgServerDataType *dt,
                                                 const gchar *sqlname);
    const gchar* mg_server_data_type_get_sqlname
                                                (MgServerDataType *dt);
    void        mg_server_data_type_set_gda_type
                                                (MgServerDataType *dt,
                                                 GdaValueType gda_type);
    GdaValueType mg_server_data_type_get_gda_type
                                                (MgServerDataType *dt);
    void        mg_server_data_type_set_handler (MgServerDataType *dt,
                                                 MgDataHandler *dh);
    MgDataHandler* mg_server_data_type_get_handler
                                                (MgServerDataType *dt);

## Object Hierarchy

      GObject
       +----MgBase
             +----MgServerDataType

## Implemented Interfaces

MgServerDataType implements MgXmlStorage.

## Properties

      "prop"                 gpointer             : Read / Write

## Signal Prototypes

    "templ-signal"
                void        user_function      (MgServerDataType *mgserverdatatype,
                                                gpointer user_data);

## Description

DBMS systems usually have quite large set of data types (which can sometimes be expanded by users). Each MgServerDataType object represents one data type. The libgda library provides some data types, and so it is possible, for each MgServerDataType object, to get the corresponding libgda data type.

Every data type can be represented by a MgServerDataType (even user defined data types). Complex data types (data types described as the aggregation of several other data types, like C structures) are handled like any other data type and it is not possible to individually access the different components of the complex data type (it is, however, possible to write a plugin for this data type).

It implements the MgXmlStorage interface.

## Details

### struct MgServerDataType

    struct MgServerDataType;

### struct MgServerDataTypePrivate

    struct MgServerDataTypePrivate;

### mg_server_data_type_get_type ()

    guint       mg_server_data_type_get_type    (void);

Returns : |

### mg_server_data_type_new ()

    GObject*    mg_server_data_type_new         (MgServer *srv);

Creates a new MgServerDataType object

`srv` : | a MgServer object
Returns : | the new object

### mg_server_data_type_set_sqlname ()

    void        mg_server_data_type_set_sqlname (MgServerDataType *dt,
                                                 const gchar *sqlname);

Set the SQL name of the data type.

`dt` : | a MgServerDataType object
`sqlname` : |

### mg_server_data_type_get_sqlname ()

    const gchar* mg_server_data_type_get_sqlname
                                                (MgServerDataType *dt);

Get the DBMS's name of a data type.

`dt` : | a MgServerDataType object
Returns : | the name of the data type

### mg_server_data_type_set_gda_type ()

    void        mg_server_data_type_set_gda_type
                                                (MgServerDataType *dt,
                                                 GdaValueType gda_type);

Set the gda type for a data type

`dt` : | a MgServerDataType object
`gda_type` : |

### mg_server_data_type_get_gda_type ()

    GdaValueType mg_server_data_type_get_gda_type
                                                (MgServerDataType *dt);

Get the gda type of a data type

`dt` : | a MgServerDataType object
Returns : | the gda type

### mg_server_data_type_set_handler ()

    void        mg_server_data_type_set_handler (MgServerDataType *dt,
                                                 MgDataHandler *dh);

Forces the MgDataHandler associated with the data type.

`dt` : | a MgServerDataType object
`dh` : | an object which implements the MgDataHandler interface

### mg_server_data_type_get_handler ()

    MgDataHandler* mg_server_data_type_get_handler
                                                (MgServerDataType *dt);

Get the MgDataHandler associated with the data type.

`dt` : | a MgServerDataType object
Returns : | the MgDataHandler

## Properties

"`prop`" (gpointer : Read / Write) |

## Signals

### The "templ-signal" signal

    void        user_function                  (MgServerDataType *mgserverdatatype,
                                                gpointer user_data);

`mgserverdatatype` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.