libgdamm Reference Documentation

Main Page Namespaces Book

# Gnome::Gda::DictDatabase Class Reference

Represents a database structure in the DBMS server. More...

Inheritance diagram for Gnome::Gda::DictDatabase:

[legend]
List of all members.

## Public Member Functions

void | add_constraint (const Glib::RefPtr<DictConstraint>& cstr)
| Add the cstr constraint to the database.
Glib::SListHandle< Glib::RefPtr< const DictConstraint > > | get_all_constraints () const
| Get a list of all the constraints applied to the database.
Glib::SListHandle< Glib::RefPtr< DictConstraint > > | get_all_constraints ()
| Get a list of all the constraints applied to the database.
Glib::SListHandle< Glib::RefPtr< const DictConstraint > > | get_all_fk_constraints () const
| Get a list of all the constraints applied to the database which represent a foreign constrains.
Glib::SListHandle< Glib::RefPtr< DictConstraint > > | get_all_fk_constraints ()
| Get a list of all the constraints applied to the database which represent a foreign constrains.
Glib::RefPtr<const Dict> | get_dict () const
| Fetch the GdaDict object to which the GdaDictDatabase belongs.
Glib::RefPtr<Dict> | get_dict ()
| Fetch the GdaDict object to which the GdaDictDatabase belongs.
Glib::RefPtr<const DictField> | get_field_by_name (const Glib::ustring& fullname) const
| Get a reference to a GdaDictField specifying the full name (table_name.field_name) of the requested field.
Glib::RefPtr<DictField> | get_field_by_name (const Glib::ustring& fullname)
| Get a reference to a GdaDictField specifying the full name (table_name.field_name) of the requested field.
Glib::RefPtr<const DictField> | get_field_by_xml_id (const Glib::ustring& xml_id) const
| Get a reference to a GdaDictField specifying its XML id.
Glib::RefPtr<DictField> | get_field_by_xml_id (const Glib::ustring& xml_id)
| Get a reference to a GdaDictField specifying its XML id.
Glib::RefPtr<const DictTable> | get_table_by_name (const Glib::ustring& name) const
| Get a reference to a GdaDictTable using its name.
Glib::RefPtr<DictTable> | get_table_by_name (const Glib::ustring& name)
| Get a reference to a GdaDictTable using its name.
Glib::RefPtr<const DictTable> | get_table_by_xml_id (const Glib::ustring& xml_id) const
| Get a reference to a GdaDictTable using its XML id.
Glib::RefPtr<DictTable> | get_table_by_xml_id (const Glib::ustring& xml_id)
| Get a reference to a GdaDictTable using its XML id.
Glib::SListHandle< Glib::RefPtr< const DictConstraint > > | get_table_constraints (const Glib::RefPtr<DictTable>& table) const
| Get all the constraints applicable to table.
Glib::SListHandle< Glib::RefPtr< DictConstraint > > | get_table_constraints (const Glib::RefPtr<DictTable>& table)
| Get all the constraints applicable to table.
Glib::SListHandle< Glib::RefPtr< const DictTable > > | get_tables () const
| Get a list of all the tables within db.
Glib::SListHandle< Glib::RefPtr< DictTable > > | get_tables ()
| Get a list of all the tables within db.
Glib::SListHandle< Glib::RefPtr< const DictConstraint > > | get_tables_fk_constraints (const Glib::RefPtr<DictTable>& table1, const Glib::RefPtr<DictTable>& table2, bool table1_has_fk=true) const
| Get a list of all the constraints applied to the database which represent a foreign key constrains, between table1 and table2.
Glib::SListHandle< Glib::RefPtr< DictConstraint > > | get_tables_fk_constraints (const Glib::RefPtr<DictTable>& table1, const Glib::RefPtr<DictTable>& table2, bool table1_has_fk=true)
| Get a list of all the constraints applied to the database which represent a foreign key constrains, between table1 and table2.
const GdaDictDatabase* | gobj () const
| Provides access to the underlying C GObject.
GdaDictDatabase* | gobj ()
| Provides access to the underlying C GObject.
GdaDictDatabase* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::SignalProxy1< void, const Glib::RefPtr<DictConstraint >&> | signal_constraint_added ()

Prototype:
  `void on_my_constraint_added(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictConstraint >&> | signal_constraint_removed ()

Prototype:
  `void on_my_constraint_removed(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictConstraint >&> | signal_constraint_updated ()

Prototype:
  `void on_my_constraint_updated(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy0<void> | signal_data_update_finished ()

Prototype:
  `void on_my_data_update_finished()`

Glib::SignalProxy0<void> | signal_data_update_started ()

Prototype:
  `void on_my_data_update_started()`

Glib::SignalProxy1< void, const Glib::RefPtr<DictField >&> | signal_field_added ()

Prototype:
  `void on_my_field_added(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictField >&> | signal_field_removed ()

Prototype:
  `void on_my_field_removed(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictField >&> | signal_field_updated ()

Prototype:
  `void on_my_field_updated(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictTable >&> | signal_table_added ()

Prototype:
  `void on_my_table_added(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictTable >&> | signal_table_removed ()

Prototype:
  `void on_my_table_removed(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy1< void, const Glib::RefPtr<DictTable >&> | signal_table_updated ()

Prototype:
  `void on_my_table_updated(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy3< void, const Glib::ustring &, int, int > | signal_update_progress ()

Prototype:
  `void on_my_update_progress(const Glib::ustring& msg, int now, int total)`

void | stop_update_dbms_data () const
| When the database updates its internal lists of DBMS objects, a call to this function will stop that update process.
bool | update_dbms_data (GType limit_to_type, const Glib::ustring& limit_obj_name)
| Synchronises the database representation with the database structure which is stored in the DBMS.
virtual | ~DictDatabase ()

## Static Public Member Functions

static Glib::RefPtr<DictDatabase> | create ()

## Protected Member Functions

| DictDatabase ()
virtual void | on_constraint_added (const Glib::RefPtr<DictConstraint>& constraint)
virtual void | on_constraint_removed (const Glib::RefPtr<DictConstraint>& constraint)
virtual void | on_constraint_updated (const Glib::RefPtr<DictConstraint>& constraint)
virtual void | on_data_update_finished ()
virtual void | on_data_update_started ()
virtual void | on_field_added (const Glib::RefPtr<DictField>& field)
virtual void | on_field_removed (const Glib::RefPtr<DictField>& field)
virtual void | on_field_updated (const Glib::RefPtr<DictField>& field)
virtual void | on_table_added (const Glib::RefPtr<DictTable>& table)
virtual void | on_table_removed (const Glib::RefPtr<DictTable>& table)
virtual void | on_table_updated (const Glib::RefPtr<DictTable>& table)
virtual void | on_update_progress (const Glib::ustring& msg, int now, int total)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gnome::Gda::DictDatabase> | wrap (GdaDictDatabase* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Represents a database structure in the DBMS server.

This object manages an internal dictionary mirroring the real database structure with objects such as DictTable (composed of Dictfield objects) and DictConstraint.

## Constructor & Destructor Documentation

virtual Gnome::Gda::DictDatabase::~DictDatabase | ( |  | ) | `[virtual]`

Gnome::Gda::DictDatabase::DictDatabase | ( |  | ) | `[protected]`

## Member Function Documentation

void Gnome::Gda::DictDatabase::add_constraint | ( | const Glib::RefPtr<DictConstraint>& | cstr | ) |

Add the cstr constraint to the database.

The cstr constraint is a user-defined constraint (which is not part of the database structure itself).

Parameters:

  | cstr | A Gda::DictConstraint.

static Glib::RefPtr<DictDatabase> Gnome::Gda::DictDatabase::create | ( |  | ) | `[static]`

Reimplemented from Gnome::Gda::Object.

Glib::SListHandle<Glib::RefPtr<const DictConstraint> > Gnome::Gda::DictDatabase::get_all_constraints | ( |  | ) | const

Get a list of all the constraints applied to the database.

Constraints are represented as Gda::DictConstraint objects and represent any type of constraint.

Returns:
  A new list of the constraints.

Glib::SListHandle<Glib::RefPtr<DictConstraint> > Gnome::Gda::DictDatabase::get_all_constraints | ( |  | ) |

Get a list of all the constraints applied to the database.

Constraints are represented as Gda::DictConstraint objects and represent any type of constraint.

Returns:
  A new list of the constraints.

Glib::SListHandle<Glib::RefPtr<const DictConstraint> > Gnome::Gda::DictDatabase::get_all_fk_constraints | ( |  | ) | const

Get a list of all the constraints applied to the database which represent a foreign constrains.

Constraints are represented as Gda::DictConstraint objects.

Returns:
  A new list of the constraints.

Glib::SListHandle<Glib::RefPtr<DictConstraint> > Gnome::Gda::DictDatabase::get_all_fk_constraints | ( |  | ) |

Get a list of all the constraints applied to the database which represent a foreign constrains.

Constraints are represented as Gda::DictConstraint objects.

Returns:
  A new list of the constraints.

Glib::RefPtr<const Dict> Gnome::Gda::DictDatabase::get_dict | ( |  | ) | const

Fetch the GdaDict object to which the GdaDictDatabase belongs.

Returns:
  The GdaDict object.

Reimplemented from Gnome::Gda::Object.

Glib::RefPtr<Dict> Gnome::Gda::DictDatabase::get_dict | ( |  | ) |

Fetch the GdaDict object to which the GdaDictDatabase belongs.

Returns:
  The GdaDict object.

Reimplemented from Gnome::Gda::Object.

Glib::RefPtr<const DictField> Gnome::Gda::DictDatabase::get_field_by_name | ( | const Glib::ustring & | fullname | ) | const

Get a reference to a GdaDictField specifying the full name (table_name.field_name) of the requested field.

Parameters:

  | fullname | The name of the requested table field.

Returns:
  The GdaDictField pointer or `0` if the requested field does not exist.

Glib::RefPtr<DictField> Gnome::Gda::DictDatabase::get_field_by_name | ( | const Glib::ustring & | fullname | ) |

Get a reference to a GdaDictField specifying the full name (table_name.field_name) of the requested field.

Parameters:

  | fullname | The name of the requested table field.

Returns:
  The GdaDictField pointer or `0` if the requested field does not exist.

Glib::RefPtr<const DictField> Gnome::Gda::DictDatabase::get_field_by_xml_id | ( | const Glib::ustring & | xml_id | ) | const

Get a reference to a GdaDictField specifying its XML id.

Parameters:

  | xml_id | The XML id of the requested table field.

Returns:
  The GdaDictField pointer or `0` if the requested field does not exist.

Glib::RefPtr<DictField> Gnome::Gda::DictDatabase::get_field_by_xml_id | ( | const Glib::ustring & | xml_id | ) |

Get a reference to a GdaDictField specifying its XML id.

Parameters:

  | xml_id | The XML id of the requested table field.

Returns:
  The GdaDictField pointer or `0` if the requested field does not exist.

Glib::RefPtr<const DictTable> Gnome::Gda::DictDatabase::get_table_by_name | ( | const Glib::ustring & | name | ) | const

Get a reference to a GdaDictTable using its name.

Parameters:

  | name | The name of the requested table.

Returns:
  The GdaDictTable pointer or `0` if the requested table does not exist.

Glib::RefPtr<DictTable> Gnome::Gda::DictDatabase::get_table_by_name | ( | const Glib::ustring & | name | ) |

Get a reference to a GdaDictTable using its name.

Parameters:

  | name | The name of the requested table.

Returns:
  The GdaDictTable pointer or `0` if the requested table does not exist.

Glib::RefPtr<const DictTable> Gnome::Gda::DictDatabase::get_table_by_xml_id | ( | const Glib::ustring & | xml_id | ) | const

Get a reference to a GdaDictTable using its XML id.

Parameters:

  | xml_id | The XML id of the requested table.

Returns:
  The GdaDictTable pointer or `0` if the requested table does not exist.

Glib::RefPtr<DictTable> Gnome::Gda::DictDatabase::get_table_by_xml_id | ( | const Glib::ustring & | xml_id | ) |

Get a reference to a GdaDictTable using its XML id.

Parameters:

  | xml_id | The XML id of the requested table.

Returns:
  The GdaDictTable pointer or `0` if the requested table does not exist.

Glib::SListHandle<Glib::RefPtr<const DictConstraint> > Gnome::Gda::DictDatabase::get_table_constraints | ( | const Glib::RefPtr<DictTable>& | table | ) | const

Get all the constraints applicable to table.

Parameters:

  | table | A Gda::DictTable, part of db.

Returns:
  A new GSList of Gda::DictConstraint objects.

Glib::SListHandle<Glib::RefPtr<DictConstraint> > Gnome::Gda::DictDatabase::get_table_constraints | ( | const Glib::RefPtr<DictTable>& | table | ) |

Get all the constraints applicable to table.

Parameters:

  | table | A Gda::DictTable, part of db.

Returns:
  A new GSList of Gda::DictConstraint objects.

Glib::SListHandle<Glib::RefPtr<const DictTable> > Gnome::Gda::DictDatabase::get_tables | ( |  | ) | const

Get a list of all the tables within db.

Returns:
  A new list of all the Gda::DictTable objects.

Glib::SListHandle<Glib::RefPtr<DictTable> > Gnome::Gda::DictDatabase::get_tables | ( |  | ) |

Get a list of all the tables within db.

Returns:
  A new list of all the Gda::DictTable objects.

Glib::SListHandle<Glib::RefPtr<const DictConstraint> > Gnome::Gda::DictDatabase::get_tables_fk_constraints | ( | const Glib::RefPtr<DictTable>& | table1,
|  | const Glib::RefPtr<DictTable>& | table2,
|  | bool | table1_has_fk = `true` |
| ) |  |  | const

Get a list of all the constraints applied to the database which represent a foreign key constrains, between table1 and table2.

If table1 or table2 are `0`, then the returned foreign key constraints are the ones between any table and table1 or table2.

Constraints are represented as Gda::DictConstraint objects.

Parameters:

  | table1 | A Gda::DictTable, or `0`.
  | table2 | A Gda::DictTable, or `0`.
  | table1_has_fk | `true` if the returned constraints are the one for which table1 contains the foreign key.

Returns:
  A new list of the constraints.

Glib::SListHandle<Glib::RefPtr<DictConstraint> > Gnome::Gda::DictDatabase::get_tables_fk_constraints | ( | const Glib::RefPtr<DictTable>& | table1,
|  | const Glib::RefPtr<DictTable>& | table2,
|  | bool | table1_has_fk = `true` |
| ) |  |  |

Get a list of all the constraints applied to the database which represent a foreign key constrains, between table1 and table2.

If table1 or table2 are `0`, then the returned foreign key constraints are the ones between any table and table1 or table2.

Constraints are represented as Gda::DictConstraint objects.

Parameters:

  | table1 | A Gda::DictTable, or `0`.
  | table2 | A Gda::DictTable, or `0`.
  | table1_has_fk | `true` if the returned constraints are the one for which table1 contains the foreign key.

Returns:
  A new list of the constraints.

const GdaDictDatabase* Gnome::Gda::DictDatabase::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::Object.

GdaDictDatabase* Gnome::Gda::DictDatabase::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Gnome::Gda::Object.

GdaDictDatabase* Gnome::Gda::DictDatabase::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Gnome::Gda::Object.

virtual void Gnome::Gda::DictDatabase::on_constraint_added | ( | const Glib::RefPtr<DictConstraint>& | constraint | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_constraint_removed | ( | const Glib::RefPtr<DictConstraint>& | constraint | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_constraint_updated | ( | const Glib::RefPtr<DictConstraint>& | constraint | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_data_update_finished | ( |  | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_data_update_started | ( |  | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_field_added | ( | const Glib::RefPtr<DictField>& | field | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_field_removed | ( | const Glib::RefPtr<DictField>& | field | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_field_updated | ( | const Glib::RefPtr<DictField>& | field | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_table_added | ( | const Glib::RefPtr<DictTable>& | table | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_table_removed | ( | const Glib::RefPtr<DictTable>& | table | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_table_updated | ( | const Glib::RefPtr<DictTable>& | table | ) | `[protected, virtual]`

virtual void Gnome::Gda::DictDatabase::on_update_progress | ( | const Glib::ustring & | msg,
|  | int | now,
|  | int | total |
| ) |  |  | `[protected, virtual]`

Glib::SignalProxy1<void,const Glib::RefPtr<DictConstraint>&> Gnome::Gda::DictDatabase::signal_constraint_added | ( |  | ) |

Prototype:
  `void on_my_constraint_added(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictConstraint>&> Gnome::Gda::DictDatabase::signal_constraint_removed | ( |  | ) |

Prototype:
  `void on_my_constraint_removed(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictConstraint>&> Gnome::Gda::DictDatabase::signal_constraint_updated | ( |  | ) |

Prototype:
  `void on_my_constraint_updated(const Glib::RefPtr<DictConstraint>& constraint)`

Glib::SignalProxy0< void > Gnome::Gda::DictDatabase::signal_data_update_finished | ( |  | ) |

Prototype:
  `void on_my_data_update_finished()`

Glib::SignalProxy0< void > Gnome::Gda::DictDatabase::signal_data_update_started | ( |  | ) |

Prototype:
  `void on_my_data_update_started()`

Glib::SignalProxy1<void,const Glib::RefPtr<DictField>&> Gnome::Gda::DictDatabase::signal_field_added | ( |  | ) |

Prototype:
  `void on_my_field_added(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictField>&> Gnome::Gda::DictDatabase::signal_field_removed | ( |  | ) |

Prototype:
  `void on_my_field_removed(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictField>&> Gnome::Gda::DictDatabase::signal_field_updated | ( |  | ) |

Prototype:
  `void on_my_field_updated(const Glib::RefPtr<DictField>& field)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictTable>&> Gnome::Gda::DictDatabase::signal_table_added | ( |  | ) |

Prototype:
  `void on_my_table_added(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictTable>&> Gnome::Gda::DictDatabase::signal_table_removed | ( |  | ) |

Prototype:
  `void on_my_table_removed(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy1<void,const Glib::RefPtr<DictTable>&> Gnome::Gda::DictDatabase::signal_table_updated | ( |  | ) |

Prototype:
  `void on_my_table_updated(const Glib::RefPtr<DictTable>& table)`

Glib::SignalProxy3< void,const Glib::ustring&,int,int > Gnome::Gda::DictDatabase::signal_update_progress | ( |  | ) |

Prototype:
  `void on_my_update_progress(const Glib::ustring& msg, int now, int total)`

void Gnome::Gda::DictDatabase::stop_update_dbms_data | ( |  | ) | const

When the database updates its internal lists of DBMS objects, a call to this function will stop that update process.

It has no effect when the database is not updating its DBMS data.

bool Gnome::Gda::DictDatabase::update_dbms_data | ( | GType | limit_to_type,
|  | const Glib::ustring & | limit_obj_name |
| ) |  |  |

Synchronises the database representation with the database structure which is stored in the DBMS.

For this operation to succeed, the connection to the DBMS server MUST be opened (using the corresponding Gda::Connection object).

Parameters:

  | limit_to_type | Limit the DBMS update to this type, or 0 for no limit.
  | limit_obj_name | Limit the DBMS update to objects of this name, or `0` for no limit.

Returns:
  `true` if no error.

## Friends And Related Function Documentation

Glib::RefPtr<Gnome::Gda::DictDatabase> wrap | ( | GdaDictDatabase * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | 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.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- dictdatabase.h