## GdaDataModel columns GdaDataModel columns — Management of GdaDataModel column attributes |

## Stability Level

Stable, unless otherwise indicated

## Functions

GdaColumn * | gda_column_new ()
GdaColumn * | gda_column_copy ()
const gchar * | gda_column_get_name ()
const gchar * | gda_column_get_description ()
const gchar * | gda_column_get_dbms_type ()
GType | gda_column_get_g_type ()
gboolean | gda_column_get_allow_null ()
gboolean | gda_column_get_auto_increment ()
gint | gda_column_get_position ()
const GValue * | gda_column_get_default_value ()
void | gda_column_set_name ()
void | gda_column_set_description ()
void | gda_column_set_dbms_type ()
void | gda_column_set_g_type ()
void | gda_column_set_allow_null ()
void | gda_column_set_auto_increment ()
void | gda_column_set_position ()
void | gda_column_set_default_value ()

## Properties

char * | desc | Read / Write
char * | id | Read / Write
char * | name | Read / Write

## Signals

void | g-type-changed | Run Last
void | name-changed | Run Last

## Types and Values

| GdaColumn

## Object Hierarchy

        GObject
        ╰── GdaColumn

## Description

The GdaColumn object represents a GdaDataModel's column and handle all its properties.

## Functions

### gda_column_new ()

    GdaColumn *
    gda_column_new (void);

#### Returns

a newly allocated GdaColumn object.

### gda_column_copy ()

    GdaColumn *
    gda_column_copy (GdaColumn *column);

Creates a new GdaColumn object from an existing one.

#### Parameters

column | column to get a copy from. |

#### Returns

a newly allocated GdaColumn with a copy of the data in `column` .

[transfer full]

### gda_column_get_name ()

    const gchar *
    gda_column_get_name (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

the name of `column` .

### gda_column_get_description ()

    const gchar *
    gda_column_get_description (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

the column's description, in any

### gda_column_get_dbms_type ()

    const gchar *
    gda_column_get_dbms_type (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

the database type of `column` .

### gda_column_get_g_type ()

    GType
    gda_column_get_g_type (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

the type of `column` .

### gda_column_get_allow_null ()

    gboolean
    gda_column_get_allow_null (GdaColumn *column);

Gets the 'allow null' flag of the given column.

#### Parameters

column | a GdaColumn. |

#### Returns

whether the given column allows null values or not (`TRUE` or `FALSE`).

### gda_column_get_auto_increment ()

    gboolean
    gda_column_get_auto_increment (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

whether the given column is an auto incremented one (`TRUE` or `FALSE`).

### gda_column_get_position ()

    gint
    gda_column_get_position (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

the position of the column refer to in the containing data model.

### gda_column_get_default_value ()

    const GValue *
    gda_column_get_default_value (GdaColumn *column);

#### Parameters

column | a GdaColumn. |

#### Returns

`column` 's default value, as a GValue object, or `NULL` if column does not have a default value.

[nullable]

### gda_column_set_name ()

    void
    gda_column_set_name (GdaColumn *column,
                         const gchar *name);

Sets the name of `column` to `name` .

#### Parameters

column | a GdaColumn. |
name | the new name of `column` . |

### gda_column_set_description ()

    void
    gda_column_set_description (GdaColumn *column,
                                const gchar *descr);

Sets the column's description

#### Parameters

column | a GdaColumn. |
descr | description. |

### gda_column_set_dbms_type ()

    void
    gda_column_set_dbms_type (GdaColumn *column,
                              const gchar *dbms_type);

Defines `column` 's database type

#### Parameters

column | a GdaColumn |
dbms_type | a string |

### gda_column_set_g_type ()

    void
    gda_column_set_g_type (GdaColumn *column,
                           GType type);

Sets the type of `column` to `type` .

#### Parameters

column | a GdaColumn. |
type | the new type of `column` . |

### gda_column_set_allow_null ()

    void
    gda_column_set_allow_null (GdaColumn *column,
                               gboolean allow);

Sets the 'allow null' flag of the given column.

#### Parameters

column | a GdaColumn. |
allow | whether the given column should allows null values or not. |

### gda_column_set_auto_increment ()

    void
    gda_column_set_auto_increment (GdaColumn *column,
                                   gboolean is_auto);

Sets the auto increment flag for the given column.

#### Parameters

column | a GdaColumn. |
is_auto | auto increment status. |

### gda_column_set_position ()

    void
    gda_column_set_position (GdaColumn *column,
                             gint position);

Sets the position of the column refer to in the containing data model.

#### Parameters

column | a GdaColumn. |
position | the wanted position of the column in the containing data model. |

### gda_column_set_default_value ()

    void
    gda_column_set_default_value (GdaColumn *column,
                                  const GValue *default_value);

Sets `column` 's default GValue.

#### Parameters

column | a GdaColumn. |
default_value | default GValue for the column. | [nullable]

## Types and Values

### GdaColumn

    typedef struct _GdaColumn GdaColumn;

## Property Details

### The `“desc”` property

      “desc”                     char *

Column's description.

Owner: GdaColumn

Flags: Read / Write

Default value: NULL

### The `“id”` property

      “id”                       char *

Column's Id (warning: the column's ID is not guaranteed to be unique in a GdaDataModel).

Owner: GdaColumn

Flags: Read / Write

Default value: NULL

### The `“name”` property

      “name”                     char *

Column's name.

Owner: GdaColumn

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“g-type-changed”` signal

    void
    user_function (GdaColumn *column,
                   GType     *old_type,
                   GType     *new_type,
                   gpointer   user_data)

Gets emitted whenever `column` 's type has been changed

#### Parameters

column | the GdaColumn object |
old_type | the column's previous type |
new_type | the column's new type |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“name-changed”` signal

    void
    user_function (GdaColumn *column,
                   char      *old_name,
                   gpointer   user_data)

Gets emitted whenever `column` 's name has been changed

#### Parameters

column | the GdaColumn object |
old_name | the column's previous name |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

GdaDataModel