libgdamm
4.99.7
|
In-memory representation of some database objects. More...
Public Member Functions | |
virtual | ~MetaStruct () |
GdaMetaStruct* | gobj () |
Provides access to the underlying C GObject. More... | |
const GdaMetaStruct* | gobj () const |
Provides access to the underlying C GObject. More... | |
GdaMetaStruct* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
GdaMetaDbObject* | complement (MetaDbObjectType type, const Value& catalog, const Value& schema, const Value& name) |
Creates a new Gda::MetaDbObject structure in mstruct to represent the database object (of type type) which can be uniquely identified as catalog. More... | |
bool | complement_schema (const Value& catalog, const Value& schema) |
This method is similar to complement() but creates Gda::MetaDbObject for all the database object which are in the schema schema (and in the catalog catalog). More... | |
bool | complement_default () |
This method is similar to complement() and 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). More... | |
bool | sort_db_object (MetaSortType sort_type) |
Reorders the list of database objects within mstruct in a way specified by sort_type. More... | |
GdaMetaDbObject* | get_db_object (const Value& catalog, const Value& schema, const Value& name) |
Tries to locate the Gda::MetaDbObject structure representing the database object named after catalog, schema and name. More... | |
GdaMetaTableColumn* | get_table_column (GdaMetaTable* table, const Value& col_name) |
Glib::ustring | dump_as_graph (MetaGraphInfo info) |
Creates a new graph (in the GraphViz syntax) representation of mstruct. More... | |
bool | complement_all () |
This method is similar to complement() and complement_default() but creates Gda::MetaDbObject for all the database object. More... | |
GSList* | get_all_db_objects () |
Get a list of all the Gda::MetaDbObject structures representing database objects in mstruct. More... | |
Glib::PropertyProxy_ReadOnly < guint > | property_features () const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. More... | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static Glib::RefPtr< MetaStruct > | create (const Glib::RefPtr< MetaStore >& store, MetaStructFeature features=META_STRUCT_FEATURE_ALL) |
Protected Member Functions | |
MetaStruct (const Glib::RefPtr< MetaStore >& meta_store, MetaStructFeature features) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr < Gnome::Gda::MetaStruct > | wrap (GdaMetaStruct* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
In-memory representation of some database objects.
The Gda::MetaStruct object reads data from a Gda::MetaStore object and creates an easy to use in memory representation for some database objects. For example one can easily analyse the columns of a table (or its foreign keys) using a Gda::MetaStruct.
When created, the new Gda::MetaStruct object is empty (it does not have any information about any database object). Information about database objects is computed upon request using the gda_meta_struct_complement() method. Information about individual database objects is represented by GdaMetaDbObject structures, which can be obtained using get_db_object() or get_all_db_objects().
Note that the Gda::MetaDbObject structures may change or may be removed or replaced by others, so it not advised to keep pointers to these structures: pointers to these structures should be considered valid as long as complement() and other similar functions have not been called.
|
virtual |
|
explicitprotected |
GdaMetaDbObject* Gnome::Gda::MetaStruct::complement | ( | MetaDbObjectType | type, |
const Value& | catalog, | ||
const Value& | schema, | ||
const Value& | name | ||
) |
Creates a new Gda::MetaDbObject structure in mstruct to represent the database object (of type type) which can be uniquely identified as catalog.
schema. name.
If catalog is not 0
, then schema should not be 0
.
If both catalog and schema are 0
, 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 0
and schema is not 0
, 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:
For more information, see the meta data section about SQL identifiers.
type | The type of object to add (which can be GDA_META_DB_UNKNOWN). |
catalog | The catalog the object belongs to (as a G_TYPE_STRING GValue), or 0 . |
schema | The schema the object belongs to (as a G_TYPE_STRING GValue), or 0 . |
name | The object's name (as a G_TYPE_STRING GValue), not 0 . |
0
. bool Gnome::Gda::MetaStruct::complement_all | ( | ) |
This method is similar to complement() and complement_default() but creates Gda::MetaDbObject for all the database object.
Please refer to complement() form more information.
true
if no error occurred. bool Gnome::Gda::MetaStruct::complement_default | ( | ) |
This method is similar to complement() and 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 complement() form more information.
true
if no error occurred. This method is similar to complement() but creates Gda::MetaDbObject for all the database object which are in the schema schema (and in the catalog catalog).
If catalog is 0
, then any catalog will be used, and if schema is 0
then any schema will be used (if schema is 0
then catalog must also be 0
).
Please refer to complement() form more information.
catalog | Name of a catalog, or 0 . |
schema | Name of a schema, or 0 . |
true
if no error occurred.
|
static |
Glib::ustring Gnome::Gda::MetaStruct::dump_as_graph | ( | MetaGraphInfo | info | ) |
Creates a new graph (in the GraphViz syntax) representation of mstruct.
info | Informs what kind of information to show in the resulting graph. |
0
if an error occurred. GSList* Gnome::Gda::MetaStruct::get_all_db_objects | ( | ) |
Get a list of all the Gda::MetaDbObject structures representing database objects in mstruct.
Note that no Gda::MetaDbObject structure must not be modified.
GdaMetaDbObject* Gnome::Gda::MetaStruct::get_db_object | ( | const Value& | catalog, |
const Value& | schema, | ||
const Value& | name | ||
) |
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 0
, and more than one database object matches the name, then the return value is also 0
.
catalog | The catalog the object belongs to (as a G_TYPE_STRING GValue), or 0 . |
schema | The schema the object belongs to (as a G_TYPE_STRING GValue), or 0 . |
name | The object's name (as a G_TYPE_STRING GValue), not 0 . |
0
if not found. GdaMetaTableColumn* Gnome::Gda::MetaStruct::get_table_column | ( | GdaMetaTable * | table, |
const Value& | col_name | ||
) |
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GdaMetaStruct* Gnome::Gda::MetaStruct::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::PropertyProxy_ReadOnly< guint > Gnome::Gda::MetaStruct::property_features | ( | ) | const |
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
bool Gnome::Gda::MetaStruct::sort_db_object | ( | MetaSortType | sort_type | ) |
Reorders the list of database objects within mstruct in a way specified by sort_type.
sort_type | The kind of sorting requested. |
true
if no error occurred.
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |