| libgda API reference | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> |
"changed" void user_function (GdaXmlDatabase *gdaxmldatabase, gpointer user_data); |
The GdaXmlDatabase object provides a convenient way of managing the contents of a XML database file, that is, the files used by libgda for importing/exporting data between GDA data sources.
The format being used for this file is XML, which provides a powerful way of describing a whole database (tables, views, etc), so that we can easily copy data from one data source to another, unrelated, one.
Thus, this module provides the functions you need to programatically read and write this kind of files, so that you can yourself use the import/export features of libgda.
GdaXmlDatabase* gda_xml_database_new (void); |
Creates a new GdaXmlDatabase object, which can be used to describe a database which will then be loaded by a provider to create its defined structure
GdaXmlDatabase* gda_xml_database_new_from_file (const gchar *filename); |
void gda_xml_database_free (GdaXmlDatabase *xmldb); |
Destroys the given XML database
gboolean gda_xml_database_save (GdaXmlDatabase *xmldb, const gchar *filename); |
void gda_xml_database_changed (GdaXmlDatabase *xmldb); |
Emit the "changed" signal for the given XML database
GList* gda_xml_database_get_tables (GdaXmlDatabase *xmldb); |
| xmldb : | XML database |
| Returns : | a list with the names of all the tables that are present in the given GdaXmlDatabase object |
GdaXmlDatabaseTable* gda_xml_database_table_new (GdaXmlDatabase *xmldb, const gchar *name); |
Add a new table description to the given XML database. If tname already exists, this function fails.
void gda_xml_database_table_remove (GdaXmlDatabase *xmldb, GdaXmlDatabaseTable *table); |
GdaXmlDatabaseTable* gda_xml_database_table_find (GdaXmlDatabase *xmldb, const gchar *name); |
Looks for the specified table in a XML database
const gchar* gda_xml_database_table_get_name
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseTable *table); |
void gda_xml_database_table_set_name (GdaXmlDatabase *xmldb, GdaXmlDatabaseTable *table, const gchar *name); |
const gchar* gda_xml_database_table_get_owner
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseTable *table); |
void gda_xml_database_table_set_owner
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseTable *table,
const gchar *owner); |
gint gda_xml_database_table_field_count
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseTable *table); |
GdaXmlDatabaseField* gda_xml_database_table_add_field (GdaXmlDatabase *xmldb, GdaXmlDatabaseTable *table, const gchar *fname); |
Add a new field to the given table
void gda_xml_database_table_remove_field
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseTable *table,
const gchar *fname); |
GdaXmlDatabaseField* gda_xml_database_table_get_field (GdaXmlDatabase *xmldb, GdaXmlDatabaseTable *table, gint pos); |
GdaXmlDatabaseField* gda_xml_database_table_find_field (GdaXmlDatabase *xmldb, GdaXmlDatabaseTable *table, const gchar *fname); |
Look for the given field in the given table
const gchar* gda_xml_database_field_get_name
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseField *field); |
Return the name of the given field
void gda_xml_database_field_set_name (GdaXmlDatabase *xmldb, GdaXmlDatabaseField *field, const gchar *name); |
const gchar* gda_xml_database_field_get_gdatype
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseField *field); |
void gda_xml_database_field_set_gdatype
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseField *field,
const gchar *type); |
gint gda_xml_database_field_get_size (GdaXmlDatabase *xmldb, GdaXmlDatabaseField *field); |
void gda_xml_database_field_set_size (GdaXmlDatabase *xmldb, GdaXmlDatabaseField *field, gint size); |
gint gda_xml_database_field_get_scale
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseField *field); |
void gda_xml_database_field_set_scale
(GdaXmlDatabase *xmldb,
GdaXmlDatabaseField *field,
gint scale); |