## GdaRow GdaRow — Individual row of a GdaDataModelArray object |

## Stability Level

Stable, unless otherwise indicated

## Functions

GdaRow * | gda_row_new ()
gint | gda_row_get_length ()
GValue * | gda_row_get_value ()
void | gda_row_invalidate_value ()
void | gda_row_invalidate_value_e ()
gboolean | gda_row_value_is_valid ()
gboolean | gda_row_value_is_valid_e ()

## Properties

GdaDataModel * | model | Read / Write / Construct Only
int | model-row | Read / Write / Construct Only
int | nb-values | Read / Write / Construct Only

## Types and Values

| GdaRow

## Object Hierarchy

        GObject
        ╰── GdaRow

## Description

The GdaDataModelArray object uses GdaRow to store each row of data. Each GdaRow has the same number of GValue values (equal to the number of columns of the data model).

As a side note, the GdaRow object is also used internally by the implementation of the data models returned when executing a SELECT statement.

## Functions

### gda_row_new ()

    GdaRow *
    gda_row_new (gint count);

Creates a GdaRow which can hold `count` GValue values.

#### Parameters

count | number of GValue in the new GdaRow. |

#### Returns

a newly allocated GdaRow object.

### gda_row_get_length ()

    gint
    gda_row_get_length (GdaRow *row);

#### Parameters

row | a GdaRow. |

#### Returns

the number of columns that the `row` has.

### gda_row_get_value ()

    GValue *
    gda_row_get_value (GdaRow *row,
                       gint num);

Gets a pointer to a GValue stored in a GdaRow.

This is a pointer to the internal array of values. Don't try to free or modify it (modifying is reserved to database provider's implementations).

#### Parameters

row | a GdaRow |
num | field index. |

#### Returns

a pointer to the GValue in the position `num` of `row` .

[nullable][transfer none]

### gda_row_invalidate_value ()

    void
    gda_row_invalidate_value (GdaRow *row,
                              GValue *value);

Marks `value` as being invalid. This method is mainly used by database providers' implementations to report any error while reading a value from the database.

#### Parameters

row | a GdaRow |
value | a GValue belonging to `row` (obtained with `gda_row_get_value()`). |

### gda_row_invalidate_value_e ()

    void
    gda_row_invalidate_value_e (GdaRow *row,
                                GValue *value,
                                GError *error);

Marks `value` as being invalid. This method is mainly used by database providers' implementations to report any error while reading a value from the database.

#### Parameters

row | a GdaRow |
value | a GValue belonging to `row` (obtained with `gda_row_get_value()`). |
error | the error which lead to the invalidation. | [nullable][transfer full]

Since: 4.2.10

### gda_row_value_is_valid ()

    gboolean
    gda_row_value_is_valid (GdaRow *row,
                            GValue *value);

Tells if `value` has been marked as being invalid by `gda_row_invalidate_value()`. This method is mainly used by database providers' implementations to report any error while reading a value from the database.

#### Parameters

row | a GdaRow. |
value | a GValue belonging to `row` (obtained with `gda_row_get_value()`). |

#### Returns

`TRUE` if `value` is valid

### gda_row_value_is_valid_e ()

    gboolean
    gda_row_value_is_valid_e (GdaRow *row,
                              GValue *value,
                              GError **error);

Tells if `value` has been marked as being invalid by `gda_row_invalidate_value()`. This method is mainly used by database providers' implementations to report any error while reading a value from the database.

#### Parameters

row | a GdaRow. |
value | a GValue belonging to `row` (obtained with `gda_row_get_value()`). |
error | a place to store the invalid error, or `NULL`. | [nullable]

#### Returns

`TRUE` if `value` is valid

Since: 4.2.10

## Types and Values

### GdaRow

    typedef struct _GdaRow GdaRow;

## Property Details

### The `“model”` property

      “model”                    GdaDataModel *

Data model used to get values from.

Owner: GdaRow

Flags: Read / Write / Construct Only

### The `“model-row”` property

      “model-row”                int

Row number in data model to get data from.

Owner: GdaRow

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0

### The `“nb-values”` property

      “nb-values”                int

Number of values in the row.

Owner: GdaRow

Flags: Read / Write / Construct Only

Allowed values: >= 1

Default value: 1

## See Also

GdaDataModelArray