## GdaDbIndexField GdaDbIndexField — Object to represent table index |

## Stability Level

Stable, unless otherwise indicated

## Functions

GdaDbIndexField * | gda_db_index_field_new ()
void | gda_db_index_field_set_column ()
GdaDbColumn * | gda_db_index_field_get_column ()
void | gda_db_index_field_set_collate ()
const gchar * | gda_db_index_field_get_collate ()
void | gda_db_index_field_set_sort_order ()
GdaDbIndexSortOrder | gda_db_index_field_get_sort_order ()
const gchar * | gda_db_index_field_get_sort_order_str ()

## Types and Values

#define | GDA_TYPE_DB_INDEX_FIELD
enum | GdaDbIndexSortOrder
| GdaDbIndexField

## Object Hierarchy

        GObject
        ╰── GdaDbIndexField

## Includes

    #include <libgda/libgda.h>

## Description

This object is a container for information needed to create an index for a table. After population with information, it should be passed to the GdaDbIndex instance. See GdaDbIndex section for the example.

## Functions

### gda_db_index_field_new ()

    GdaDbIndexField *
    gda_db_index_field_new (void);

Create a new instance of GdaDbIndexField

#### Returns

A new instance of GdaDbIndexField.

[transfer full]

Since: 6.0

Stability Level: Stable

### gda_db_index_field_set_column ()

    void
    gda_db_index_field_set_column (GdaDbIndexField *self,
                                   GdaDbColumn *column);

Only full name will be extracted from `column` . The `column` instance should be freed using `g_object_unref()`. The instance `self` take a copy of the `column` object by increasing its referecne count.

#### Parameters

self | an instance of GdaDbIndexField |
column | column to add index to |

Since: 6.0

Stability Level: Stable

### gda_db_index_field_get_column ()

    GdaDbColumn *
    gda_db_index_field_get_column (GdaDbIndexField *self);

Returns an active column that was asigned to GdaDbIndexField instance

#### Parameters

self | a GdaDbIndexField instance |

#### Returns

A GdaDbColumn where index should be added.

[transfer none]

Since: 6.0

Stability Level: Stable

### gda_db_index_field_set_collate ()

    void
    gda_db_index_field_set_collate (GdaDbIndexField *self,
                                    const gchar *collate);

Unfortunately, collate can vary from provider to provider. This method accepts collate name as a string but user should provide valid values. For instance, SQLite3 accepts only "BINARY", "NOCASE", and "RTRIM" values. PostgreSQL, on the other hand expects a name of a callable object, e.g. function.

#### Parameters

self | instance of GdaDbIndexField |
collate | collate to set |

Since: 6.0

Stability Level: Stable

### gda_db_index_field_get_collate ()

    const gchar *
    gda_db_index_field_get_collate (GdaDbIndexField *self);

#### Parameters

self | instance of GdaDbIndexField |

#### Returns

Collate value

Since: 6.0

Stability Level: Stable

### gda_db_index_field_set_sort_order ()

    void
    gda_db_index_field_set_sort_order (GdaDbIndexField *self,
                                       GdaDbIndexSortOrder sorder);

#### Parameters

self | object to use |
sorder | sort order to set |

Since: 6.0

Stability Level: Stable

### gda_db_index_field_get_sort_order ()

    GdaDbIndexSortOrder
    gda_db_index_field_get_sort_order (GdaDbIndexField *self);

#### Parameters

self | object to use |

#### Returns

sort order as a GdaDbIndexSortOrder object

Since: 6.0

Stability Level: Stable

### gda_db_index_field_get_sort_order_str ()

    const gchar *
    gda_db_index_field_get_sort_order_str (GdaDbIndexField *self);

#### Parameters

self | an instance of GdaDbIndexField |

#### Returns

SORT ORDER string or `NULL`

Since: 6.0

Stability Level: Stable

## Types and Values

### GDA_TYPE_DB_INDEX_FIELD

    #define GDA_TYPE_DB_INDEX_FIELD (gda_db_index_field_get_type())

### enum GdaDbIndexSortOrder

Enum values to specify the sorting

#### Members

GDA_DB_INDEX_SORT_ORDER_ASC | ascending sorting |
GDA_DB_INDEX_SORT_ORDER_DESC | descending sorting |

### GdaDbIndexField

    typedef struct _GdaDbIndexField GdaDbIndexField;

## See Also

GdaDbTable, GdaDbCatalog