Gda.MetaStruct

g GObject.Object GObject.Object Gda.MetaStruct Gda.MetaStruct GObject.Object->Gda.MetaStruct

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class error_quark ()
class new (store, features)
  complement (type, catalog, schema, name)
  complement_all ()
  complement_default ()
  complement_depend (dbo)
  complement_schema (catalog, schema)
  dump_as_graph (info)
  get_all_db_objects ()
  get_db_object (catalog, schema, name)
  load_from_xml_file (catalog, schema, xml_spec_file)
  sort_db_objects (sort_type)

Virtual Methods

Inherited:GObject.Object (7)

Properties

Name Type Flags Short Description
features int r/w/co  
meta-store Gda.MetaStore r/w/co Gda.MetaStore object to fetch information from

Signals

Inherited:GObject.Object (1)

Fields

Inherited:GObject.Object (1)
Name Type Access Description
object GObject.Object r  

Class Details

class Gda.MetaStruct(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:Gda.MetaStructClass
classmethod error_quark()
Return type:int
classmethod new(store, features)
Parameters:
Returns:

the newly created Gda.MetaStruct object

Return type:

Gda.MetaStruct

Creates a new Gda.MetaStruct object. The features specifies the extra features which will also be computed: the more features, the more time it takes to run. Features such as table’s columns, each column’s attributes, etc are not optional and will always be computed.

complement(type, catalog, schema, name)
Parameters:
Raises:

GLib.Error

Returns:

the Gda.MetaDbObject corresponding to the database object if no error occurred, or None

Return type:

Gda.MetaDbObject

Creates a new Gda.MetaDbObject structure in self to represent the database object (of type type) which can be uniquely identified as catalog.`schema`.`name`.

If catalog is not None, then schema should not be None.

If both catalog and schema are None, then the database object will be the one which is “visible” by default (that is which can be accessed only by its short name name).

If catalog is None and schema is not None, then the database object will be the one which can be accessed by its schema.`name` name.

Important note: catalog, schema and name will be used using the following convention:

  • be surrounded by double quotes for a case sensitive search
  • otherwise for case insensitive search

For more information, see the ‘meta data section about SQL identifiers [information_schema:sql_identifiers]’.

complement_all()
Raises:GLib.Error
Returns:True if no error occurred
Return type:bool

This method is similar to Gda.MetaStruct.complement() and Gda.MetaStruct.complement_default() but creates Gda.MetaDbObject for all the database object.

Please refer to Gda.MetaStruct.complement() form more information.

complement_default()
Raises:GLib.Error
Returns:True if no error occurred
Return type:bool

This method is similar to Gda.MetaStruct.complement() and Gda.MetaStruct.complement_all() but creates Gda.MetaDbObject for all the database object which are usable using only their short name (that is which do not need to be prefixed by the schema in which they are to be used).

Please refer to Gda.MetaStruct.complement() form more information.

complement_depend(dbo)
Parameters:dbo (Gda.MetaDbObject) – a Gda.MetaDbObject part of self
Raises:GLib.Error
Returns:True if no error occurred
Return type:bool

This method is similar to Gda.MetaStruct.complement() but creates Gda.MetaDbObject for all the dependencies of dbo.

Please refer to Gda.MetaStruct.complement() form more information.

complement_schema(catalog, schema)
Parameters:
Raises:

GLib.Error

Returns:

True if no error occurred

Return type:

bool

This method is similar to Gda.MetaStruct.complement() but creates Gda.MetaDbObject for all the database object which are in the schema schema (and in the catalog catalog). If catalog is None, then any catalog will be used, and if schema is None then any schema will be used (if schema is None then catalog must also be None).

Please refer to Gda.MetaStruct.complement() form more information.

dump_as_graph(info)
Parameters:info (Gda.MetaGraphInfo) – informs what kind of information to show in the resulting graph
Raises:GLib.Error
Returns:a new string, or None if an error occurred.
Return type:str

Creates a new graph (in the GraphViz syntax) representation of self.

get_all_db_objects()
Returns:a new GLib.SList list of pointers to Gda.MetaDbObject structures which must be destroyed after usage using g_slist_free(). The individual Gda.MetaDbObject must not be modified.
Return type:[Gda.MetaDbObject]

Get a list of all the Gda.MetaDbObject structures representing database objects in self. Note that no Gda.MetaDbObject structure must not be modified.

get_db_object(catalog, schema, name)
Parameters:
Returns:

the Gda.MetaDbObject or None if not found

Return type:

Gda.MetaDbObject

Tries to locate the Gda.MetaDbObject structure representing the database object named after catalog, schema and name.

If one or both of catalog and schema are None, and more than one database object matches the name, then the return value is also None.

load_from_xml_file(catalog, schema, xml_spec_file)
Parameters:
  • catalog (str or None) – the catalog name, or None
  • schema (str or None) – the schema name, or None
  • xml_spec_file (str) – the specifications as the name of an XML file
Raises:

GLib.Error

Returns:

True if no error has occurred

Return type:

bool

Loads an XML description into self. This method is still experimental and no description the XML file structure is given, and no guarantee that it will remain as it is given.

sort_db_objects(sort_type)
Parameters:sort_type (Gda.MetaSortType) – the kind of sorting requested
Raises:GLib.Error
Returns:True if no error occurred
Return type:bool

Reorders the list of database objects within self in a way specified by sort_type.

Property Details

Gda.MetaStruct.props.features
Name:features
Type:int
Default Value:3
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY
Gda.MetaStruct.props.meta_store
Name:meta-store
Type:Gda.MetaStore
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

Gda.MetaStore object to fetch information from