Gda.DataAccessWrapper

g GObject.GInterface GObject.GInterface Gda.DataModel Gda.DataModel GObject.GInterface->Gda.DataModel GObject.Object GObject.Object Gda.DataAccessWrapper Gda.DataAccessWrapper GObject.Object->Gda.DataAccessWrapper Gda.DataModel->Gda.DataAccessWrapper

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gda.DataModel (43)

Structs:

GObject.ObjectClass (5)

class

new (model)

set_mapping (mapping)

Virtual Methods

Inherited:

GObject.Object (7), Gda.DataModel (27)

Properties

Name

Type

Flags

Short Description

model

Gda.DataModel

r/w/co

Data model being wrapped

Signals

Inherited:

GObject.Object (1), Gda.DataModel (6)

Fields

Inherited:

GObject.Object (1), Gda.DataModel (6)

Name

Type

Access

Description

object

GObject.Object

r

Class Details

class Gda.DataAccessWrapper(**kwargs)
Bases:

GObject.Object, Gda.DataModel

Abstract:

No

Structure:

Gda.DataAccessWrapperClass

classmethod new(model)
Parameters:

model (Gda.DataModel) – a Gda.DataModel

Returns:

a pointer to the newly created Gda.DataModel.

Return type:

Gda.DataModel

Creates a new Gda.DataModel object which buffers the rows of model. This object is useful only if model can only be accessed using cursor based method.

set_mapping(mapping)
Parameters:

mapping ([int] or None) – an array of int which represents the mapping between self's columns and the columns of the wrapped data model

Returns:

True if the mapping actually changed

Return type:

bool

self will report as many columns as mapping_size, and for each value at position ‘i’ in mapping, self will report the ‘i’th column, mapped to the wrapped data model column at position mapping[i]. For example if mapping is {3, 4, 0}, then self will report 3 columns, respectively mapped to the 4th, 5th and 1st columns of the wrapped data model (as column numbers start at 0).

If mapping is None, then no mapping is done and self's columns will be the same as the wrapped data model.

If a column in mapping does not exist in the wrapped data model, then it is simply ignored (no error reported).

Please note that if self has already been used and if the wrapped data model offers a cursor forward access mode, then this method will return False and no action will be done.

If the mapping is applied, then any existing iterator will be invalid, and self is reset as if it had just been created.

New in version 5.2.

Property Details

Gda.DataAccessWrapper.props.model
Name:

model

Type:

Gda.DataModel

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Data model being wrapped