| GNOME Data Access 5 manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
struct GdaDataModelBdb; struct GdaDataModelBdbClass; GdaDataModelBdbPrivate; GdaDataModel * gda_data_model_bdb_new (const gchar *filename,const gchar *db_name); const GSList * gda_data_model_bdb_get_errors (GdaDataModelBdb *model); void gda_data_model_bdb_clean_errors (GdaDataModelBdb *model);
The GdaDataModelBdb object allows to access the contents of a Berkeley DB database as a GdaDataModel object.
By default the resulting GdaDataModel contains only two columns (named "key" and "data") of type
GDA_TYPE_BINARY, but this object can be subclassed to convert the key or data part of a BDB record
into several columns (implement the create_key_columns(), create_data_columns(), get_key_part(), and get_data_part()
virtual methods).
Note: this type of data model is available only if the Berkeley DB library was found at compilation time.
struct GdaDataModelBdbClass {
GObjectClass parent_class;
/* virtual methods */
GSList *(*create_key_columns) (GdaDataModelBdb *model);
GSList *(*create_data_columns) (GdaDataModelBdb *model);
GValue *(*get_key_part) (GdaDataModelBdb *model,
gpointer data, gint length, gint part);
GValue *(*get_data_part) (GdaDataModelBdb *model,
gpointer data, gint length, gint part);
gboolean (*update_key_part) (GdaDataModelBdb *model,
gpointer data, gint length, gint part,
const GValue *value, GError **error);
gboolean (*update_data_part) (GdaDataModelBdb *model,
gpointer data, gint length, gint part,
const GValue *value, GError **error);
};
GdaDataModel * gda_data_model_bdb_new (const gchar *filename,const gchar *db_name);
Creates a new GdaDataModel object to access the contents of the Berkeley DB file file,
for the database db_name if not NULL
|
name of the file containing the database |
|
the name of the database within filename, or NULL. [allow-none]
|
Returns : |
a new GdaDataModel. [transfer full] |
const GSList * gda_data_model_bdb_get_errors (GdaDataModelBdb *model);
Get the list of errors which have occurred while using model
|
a GdaDataModelBdb object |
Returns : |
a read-only list of GError pointers, or NULL if no error has occurred. [element-type GObject.Error][transfer none]
|
void gda_data_model_bdb_clean_errors (GdaDataModelBdb *model);
Reset the list of errors which have occurred while using model
|
a GdaDataModelBdb object |