Top |
Subclassing GdaDataSelectSubclassing GdaDataSelect — Base class for all the data models returned by DBMS providers when a SELECT statement is executed |
void | gda_data_select_take_row () |
GdaRow * | gda_data_select_get_stored_row () |
GdaConnection * | gda_data_select_get_connection () |
void | gda_data_select_set_columns () |
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 () |
gchar * | gda_alphanum_to_text () |
gchar * | gda_text_to_alphanum () |
gboolean | gda_data_model_iter_move_next_default () |
gboolean | gda_data_model_iter_move_prev_default () |
void | gda_row_invalidate_value () |
void | gda_row_invalidate_value_e () |
gboolean | gda_row_value_is_valid () |
gboolean | gda_row_value_is_valid_e () |
All database providers should subclass this class when returning a data model after the execution of a SELECT statement. Specifically it has the following features:
See the Virtual methods for recordsets section for more information about how to implement the virtual methods of the subclassed object.
This section documents the methods available for the database provider's implementations.
void gda_data_select_take_row (GdaDataSelect *model
,GdaRow *row
,gint rownum
);
Stores row
into model
, externally advertized at row number rownum
(if no row has been removed).
The reference to row
is stolen.
This function is used by database provider's implementations
model |
a GdaDataSelect data model |
|
row |
a GdaRow row. |
[transfer full] |
rownum |
"external" advertized row number |
GdaRow * gda_data_select_get_stored_row (GdaDataSelect *model
,gint rownum
);
Get the GdaRow object stored within model
at row rownum
(without taking care of removed rows)
GdaConnection *
gda_data_select_get_connection (GdaDataSelect *model
);
Get a pointer to the GdaConnection object which was used when model
was created
(and which may be used internally by model
).
void gda_data_select_set_columns (GdaDataSelect *model
,GSList *columns
);
Makes columns
the list of columns for model
. Both the list and each GdaColumn object in the
list are 'stolen' by model
(ie. when this function returns the caller should not use anymore
the list or each column object in it). This method should not be used directly, it is used by
database provider's implementations.
Since: 4.2.1
void gda_column_set_name (GdaColumn *column
,const gchar *name
);
Sets the name of column
to name
.
void gda_column_set_description (GdaColumn *column
,const gchar *title
);
Sets the column's description
void gda_column_set_dbms_type (GdaColumn *column
,const gchar *dbms_type
);
Defines column
's database type
void gda_column_set_g_type (GdaColumn *column
,GType type
);
Sets the type of column
to type
.
void gda_column_set_allow_null (GdaColumn *column
,gboolean allow
);
Sets the 'allow null' flag of the given column.
void gda_column_set_auto_increment (GdaColumn *column
,gboolean is_auto
);
Sets the auto increment flag for the given column.
void gda_column_set_position (GdaColumn *column
,gint position
);
Sets the position of the column refer to in the containing data model.
column |
a GdaColumn. |
|
position |
the wanted position of the column in the containing data model. |
void gda_column_set_default_value (GdaColumn *column
,const GValue *default_value
);
Sets column
's default GValue.
gchar *
gda_alphanum_to_text (gchar *text
);
Does the opposite of gda_text_to_alphanum()
, in the same string
gchar *
gda_text_to_alphanum (const gchar *text
);
The "encoding" consists in replacing non alphanumeric character with the string "__gdaXX" where XX is the hex. representation of the non alphanumeric char.
gboolean gda_data_model_iter_move_next_default (GdaDataModel *model
,GdaDataModelIter *iter
);
Method reserved to GdaDataModelIter implementations, should not be called directly.
[skip]
gboolean gda_data_model_iter_move_prev_default (GdaDataModel *model
,GdaDataModelIter *iter
);
Method reserved to GdaDataModelIter implementations, should not be called directly.
[skip]
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.
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.
row |
a GdaRow |
|
value |
a GValue belonging to |
|
error |
the error which lead to the invalidation. |
[allow-none][transfer full] |
Since: 4.2.10
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.
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.
row |
a GdaRow. |
|
value |
a GValue belonging to |
|
error |
a place to store the invalid error, or |
[allow-none] |
Since: 4.2.10
struct GdaDataSelectClass { GObjectClass parent_class; /* GDA_DATA_MODEL_ACCESS_RANDOM */ gint (*fetch_nb_rows) (GdaDataSelect *model); gboolean (*fetch_random) (GdaDataSelect *model, GdaRow **prow, gint rownum, GError **error); gboolean (*store_all) (GdaDataSelect *model, GError **error); /* GDA_STATEMENT_MODEL_CURSOR_* */ gboolean (*fetch_next) (GdaDataSelect *model, GdaRow **prow, gint rownum, GError **error); gboolean (*fetch_prev) (GdaDataSelect *model, GdaRow **prow, gint rownum, GError **error); gboolean (*fetch_at) (GdaDataSelect *model, GdaRow **prow, gint rownum, GError **error); };