Gda.Column

g GObject.Object GObject.Object Gda.Column Gda.Column GObject.Object->Gda.Column

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

copy ()

get_allow_null ()

get_attribute (attribute)

get_auto_increment ()

get_dbms_type ()

get_default_value ()

get_description ()

get_g_type ()

get_name ()

get_position ()

set_allow_null (allow)

set_attribute (attribute, value, destroy)

set_auto_increment (is_auto)

set_dbms_type (dbms_type)

set_default_value (default_value)

set_description (title)

set_g_type (type)

set_name (name)

set_position (position)

Virtual Methods

Inherited:

GObject.Object (7)

do_g_type_changed (old_type, new_type)

do_name_changed (old_name)

Properties

Name

Type

Flags

Short Description

id

str

r/w

Column’s Id (warning: the column’s ID is not guaranteed to be unique in a Gda.DataModel)

Signals

Inherited:

GObject.Object (1)

Name

Short Description

g-type-changed

Gets emitted whenever column's type has been changed

name-changed

Gets emitted whenever column's name has been changed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

object

GObject.Object

r

Class Details

class Gda.Column(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gda.ColumnClass

classmethod new()
Returns:

a newly allocated Gda.Column object.

Return type:

Gda.Column

copy()
Returns:

a newly allocated Gda.Column with a copy of the data in self.

Return type:

Gda.Column

Creates a new Gda.Column object from an existing one.

get_allow_null()
Returns:

whether the given column allows null values or not (True or False).

Return type:

bool

Gets the ‘allow null’ flag of the given column.

get_attribute(attribute)
Parameters:

attribute (str) – attribute name as a string

Returns:

a read-only GObject.Value, or None if not attribute named attribute has been set for self

Return type:

GObject.Value

Get the value associated to a named attribute.

Attributes can have any name, but Libgda proposes some default names, see ‘this section [libgda-40-Attributes-manager.synopsis]’.

get_auto_increment()
Returns:

whether the given column is an auto incremented one (True or False).

Return type:

bool

get_dbms_type()
Returns:

the database type of self.

Return type:

str

get_default_value()
Returns:

self's default value, as a GObject.Value object, or None if column does not have a default value

Return type:

GObject.Value or None

get_description()
Returns:

the column’s description, in any

Return type:

str

get_g_type()
Returns:

the type of self.

Return type:

GObject.GType

get_name()
Returns:

the name of self.

Return type:

str

get_position()
Returns:

the position of the column refer to in the containing data model.

Return type:

int

set_allow_null(allow)
Parameters:

allow (bool) – whether the given column should allows null values or not.

Sets the ‘allow null’ flag of the given column.

set_attribute(attribute, value, destroy)
Parameters:

Set the value associated to a named attribute. The attribute string is ‘stolen’ by this method, and the memory it uses will be freed using the destroy function when no longer needed (if destroy is None, then the string will not be freed at all).

Attributes can have any name, but Libgda proposes some default names, see ‘this section [libgda-40-Attributes-manager.synopsis]’.

If there is already an attribute named attribute set, then its value is replaced with the new value (value is copied), except if value is None, in which case the attribute is removed.

For example one would use it as:

Gda.Column.set_attribute (holder, GLib.strdup (my_attribute), GLib.free, my_value); Gda.Column.set_attribute (holder, Gda.ATTRIBUTE_NAME, None, my_value);

Note: this method does not modify in any way the contents of the data model for which self is a column (nor does it modify the table definition of the tables used by a SELECT statement is the model was created from a SELECT statement).

set_auto_increment(is_auto)
Parameters:

is_auto (bool) – auto increment status.

Sets the auto increment flag for the given column.

set_dbms_type(dbms_type)
Parameters:

dbms_type (str) – a string

Defines self's database type

set_default_value(default_value)
Parameters:

default_value (GObject.Value or None) – default GObject.Value for the column

Sets self's default GObject.Value.

set_description(title)
Parameters:

title (str) – title name.

Sets the column’s description

set_g_type(type)
Parameters:

type (GObject.GType) – the new type of self.

Sets the type of self to type.

set_name(name)
Parameters:

name (str) – the new name of self.

Sets the name of self to name.

set_position(position)
Parameters:

position (int) – the wanted position of the column in the containing data model.

Sets the position of the column refer to in the containing data model.

do_g_type_changed(old_type, new_type) virtual
Parameters:
do_name_changed(old_name) virtual
Parameters:

old_name (str) –

Signal Details

Gda.Column.signals.g_type_changed(column, old_type, new_type)
Signal Name:

g-type-changed

Flags:

RUN_LAST

Parameters:

Gets emitted whenever column's type has been changed

Gda.Column.signals.name_changed(column, old_name)
Signal Name:

name-changed

Flags:

RUN_LAST

Parameters:
  • column (Gda.Column) – The object which received the signal

  • old_name (str) – the column’s previous name

Gets emitted whenever column's name has been changed

Property Details

Gda.Column.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

Column’s Id (warning: the column’s ID is not guaranteed to be unique in a Gda.DataModel)