Gda.MetaContext

Fields

Name

Type

Access

Description

column_names

[str]

r/w

an array of column names (columns of the table_name table)

column_values

[GObject.Value]

r/w

an array of values, one for each column named in column_names

columns

{str: GObject.Value}

r/w

A GLib.HashTable storing columns’ name as key and GObject.Value as column’s value.

size

int

r/w

the size of the column_names and column_values arrays

table_name

str

r/w

the name of the table in the Gda.MetaStore's internal database

Methods

class

new ()

copy ()

free ()

get_table ()

set_column (column, value, cnc)

set_columns (columns, cnc)

set_table (table)

Details

class Gda.MetaContext

The Gda.MetaContext represents a meta data modification context: the how when used with Gda.MetaStore.modify_with_context(), and the what when used with Gda.Connection.update_meta_store().

To create a new Gda.MetaContext use Gda.MetaContext.new.

To add a new column/value pair use #gda_meta_context_add_column.

To free a Gda.MetaContext, created by Gda.MetaContext.new, use Gda.AttributesManager.free.

Since 5.2, you must consider this struct as opaque. Any access to its internal must use public API. Don’t try to use Gda.MetaContext.free on a struct that was created manually.

classmethod new()
Returns:

a new Gda.MetaContext struct with a new created hash to store column name/value pairs.

Return type:

Gda.MetaContext

Creates a new Gda.MetaContext struct with a GLib.HashTable to store column/value pairs.

New in version 5.2.

copy()
Returns:

a new Gda.MetaContext

Return type:

Gda.MetaContext

Copy constructor.

New in version 5.2.

free()

Frees any resources taken by self struct. If self is None, then nothing happens.

New in version 5.2.

get_table()
Returns:

A string with the table’s name used in the context.

Return type:

str

Get table’s name to used in the context.

New in version 5.2.

set_column(column, value, cnc)
Parameters:

Sets a new column/value pair to the given context self. Column, must be a column in the given table’s name setted by Gda.MetaContext.set_table () (a table in the ‘database schema [information_schema]’). If the given column already exists it’s value is overwrited.

Column’s name and value is copied and destroyed when Gda.MetaContext.free is called.

New in version 5.2.

set_columns(columns, cnc)
Parameters:

Set columns to use in the context. The GLib.HashTable use column’s name as key and a GObject.Value as value, to represent its value.

columns incements its reference counting. Is recommended to use Gda.MetaContext.free in order to free them.

New in version 5.2.

set_table(table)
Parameters:

table (str) – a string with the table’s name to use in context

Set table’s name to use in the context. The table is one of ‘database schema [information_schema]’ used to store meta information about the database. Use “_tables” to update meta information about database’s tables.

New in version 5.2.