## GnomeDbResultSet

GnomeDbResultSet — Represents the data returned by the execution of a SELECT query as a GnomeDbDataModel

##

# Synopsis

    struct      GnomeDbResultSet;
    GType       gnome_db_result_set_get_type    (void);
    GObject*    gnome_db_result_set_new         (GnomeDbQuery *query,
                                                 GnomeDbTarget *modif_target);
    #define     gnome_db_result_set_get_nbtuples(x)
    #define     gnome_db_result_set_get_nbcols  (x)
    #define     gnome_db_result_set_get_gdavalue(x,row,col)
    #define     gnome_db_result_set_get_col_name(x,col)
    #define     gnome_db_result_set_set_col_name(x,col,name)
    #define     gnome_db_result_set_get_data_model(x)
    gboolean    gnome_db_result_set_check_model (GnomeDbResultSet *rs,
                                                 gint nbcols,
                                                 ...);
    gboolean    gnome_db_result_set_check_data_model
                                                (GdaDataModel *model,
                                                 gint nbcols,
                                                 ...);
    gchar*      gnome_db_result_set_get_row_as_string
                                                (GdaDataModel *model,
                                                 GnomeDbQuery *query,
                                                 gint row,
                                                 gchar *sep);

## Object Hierarchy

      GObject
       +----GnomeDbBase
             +----GnomeDbResultSet

## Implemented Interfaces

GnomeDbResultSet implements GnomeDbDataModel, GnomeDbEntity and GdaDataModel.

## Properties

      "init-query-replacements" gpointer             : Read
      "query-delete"         gpointer             : Read
      "query-insert"         gpointer             : Read
      "query-select"         gpointer             : Read
      "query-update"         gpointer             : Read

## Description

This object encapsulates a GdaDataModel object which is the result of the execution of a SELECT GnomeDbQuery object. It implements the GnomeDbDataModel and re-implements the GdaDataModel interface to make it possible to write back modifications to the results of the SELECT query in the database.

Objects of this class are created by the GnomeDbServer object in return of the execution of a SELECT statement (using the `gnome_db_server_do_query_as_result_set()` function call).

## Details

### struct GnomeDbResultSet

    struct GnomeDbResultSet;

### gnome_db_result_set_get_type ()

    GType       gnome_db_result_set_get_type    (void);

Returns : |

### gnome_db_result_set_new ()

    GObject*    gnome_db_result_set_new         (GnomeDbQuery *query,
                                                 GnomeDbTarget *modif_target);

Creates a new GnomeDbResultSet object which will contain the data extracted from the `query` SELECT query. If `modif_target` is not `NULL`, then the resulting data model will have modifiable values for fields belonging to the entity represented by `modif_target`.

Note: to actually have some data in the new GnomeDbResultSet object, the `gnome_db_data_model_refresh()` function will have to be called.

`query` : | a GnomeDbQuery (a SELECT query)
`modif_target` : | the target representing the modified entity, or `NULL`
Returns : | the new object

### gnome_db_result_set_get_nbtuples()

    #define     gnome_db_result_set_get_nbtuples(x)

`x` : |

### gnome_db_result_set_get_nbcols()

    #define     gnome_db_result_set_get_nbcols(x)

`x` : |

### gnome_db_result_set_get_gdavalue()

    #define     gnome_db_result_set_get_gdavalue(x,row,col)

`x` : |
`row` : |
`col` : |

### gnome_db_result_set_get_col_name()

    #define     gnome_db_result_set_get_col_name(x,col)

`x` : |
`col` : |

### gnome_db_result_set_set_col_name()

    #define     gnome_db_result_set_set_col_name(x,col,name)

`x` : |
`col` : |
`name` : |

### gnome_db_result_set_get_data_model()

    #define     gnome_db_result_set_get_data_model(x)

`x` : |

### gnome_db_result_set_check_model ()

    gboolean    gnome_db_result_set_check_model (GnomeDbResultSet *rs,
                                                 gint nbcols,
                                                 ...);

Check the column types of a resultset.

`rs` : | a GnomeDbResultSet object
`nbcols` : | the requested number of columns
`...` : | `nbcols` arguments of type GdaValueType or -1 (if any data type is accepted)
Returns : | TRUE if the resultset's columns match the provided data types and number

### gnome_db_result_set_check_data_model ()

    gboolean    gnome_db_result_set_check_data_model
                                                (GdaDataModel *model,
                                                 gint nbcols,
                                                 ...);

Check the column types of a GdaDataModel.

`model` : | a GdaDataModel object
`nbcols` : | the minimum requested number of columns
`...` : | `nbcols` arguments of type GdaValueType or -1 (if any data type is accepted)
Returns : | TRUE if the data model's columns match the provided data types and number

### gnome_db_result_set_get_row_as_string ()

    gchar*      gnome_db_result_set_get_row_as_string
                                                (GdaDataModel *model,
                                                 GnomeDbQuery *query,
                                                 gint row,
                                                 gchar *sep);

Creates a string representing, for the specified `row`, the visible fields `query`, separated by `sep`. `query` is usually the query which has been used to create the resultset.

`model` : | a GdaDataModel object
`query` : | a GnomeDbQuery object
`row` : |
`sep` : |
Returns : | a new string, or `NULL` if an error occured.

## Properties

"`init-query-replacements`" (gpointer : Read) | translate from fields of the query used for construction to the fields of the GnomeDbResultset.
"`query-delete`" (gpointer : Read) | the query which is run to delete data.
"`query-insert`" (gpointer : Read) | the query which is run to add data.
"`query-select`" (gpointer : Read) | the SELECT query which is run to fill the data model.
"`query-update`" (gpointer : Read) | the query which is run to update data.