Subclassing GdaDataSelect

Subclassing GdaDataSelect — Base class for all the data models returned by DBMS providers when a SELECT statement is executed

Stability Level

Stable, unless otherwise indicated

Description

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:

  • Manages its list of GdaColumn using the list exported by the prepared statement object (GdaPStmt)

  • Allows random or cursor based access

  • Allows for efficient memory usage allowing the subclass to finely tune its memory usage

  • Provides a generic mechanism for writable data models

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.

Functions

gda_data_select_take_row ()

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

Parameters

model

a GdaDataSelect data model

 

row

a GdaRow row.

[transfer full]

rownum

"external" advertized row number

 

gda_data_select_get_stored_row ()

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)

Parameters

model

a GdaDataSelect data model

 

rownum

"external" advertized row number

 

Returns

the requested GdaRow, or NULL if not found.

[transfer none]


gda_data_select_get_connection ()

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 ).

Parameters

model

a GdaDataSelect data model

 

Returns

a pointer to the GdaConnection, or NULL.

[transfer none]


gda_data_select_set_columns ()

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.

Parameters

model

a GdaDataSelect data model

 

columns

a lis of GdaColumn objects.

[transfer full]

Since: 4.2.1


gda_data_select_add_exception ()

void
gda_data_select_add_exception (GdaDataSelect *model,
                               GError *error);

Add an exception to model .

Parameters

model

a GdaDataSelect

 

error

an error to add as exception.

[transfer full]

Since: 4.2.6

Types and Values