![]() | ![]() | ![]() | libgda API reference | ![]() |
---|
#define GDA_CONFIG_SECTION_DATASOURCES #define GDA_CONFIG_SECTION_LAST_CONNECTIONS #define GDA_CONFIG_SECTION_LOG #define GDA_CONFIG_KEY_MAX_LAST_CONNECTIONSgchar * gda_config_get_string (constgchar *path);gint gda_config_get_int (constgchar *path);gdouble gda_config_get_float (constgchar *path);gboolean gda_config_get_boolean (constgchar *path);void gda_config_set_string (constgchar *path, constgchar *new_value);void gda_config_set_int (constgchar *path,gint new_value);void gda_config_set_float (constgchar *path,gdouble new_value);void gda_config_set_boolean (constgchar *path,gboolean new_value);void gda_config_remove_section (constgchar *path);void gda_config_remove_key (constgchar *path);gboolean gda_config_has_section (constgchar *path);gboolean gda_config_has_key (constgchar *path);void gda_config_commit (void);void gda_config_rollback (void);GList * gda_config_list_sections (constgchar *path);GList * gda_config_list_keys (constgchar *path);void gda_config_free_list (GList *list); #define GDA_PROVIDER_TYPE (srv) #define GDA_PROVIDER_NAME (srv) #define GDA_PROVIDER_COMMENT (srv) #define GDA_PROVIDER_LOCATION (srv) #define GDA_PROVIDER_REPO_ID (srv) #define GDA_PROVIDER_USERNAME (srv) #define GDA_PROVIDER_HOSTNAME (srv) #define GDA_PROVIDER_DOMAIN (srv) #define GDA_PROVIDER_DSN_PARAMS (srv)GdaProvider * gda_provider_new (void);GdaProvider * gda_provider_copy (GdaProvider *provider);void gda_provider_free (GdaProvider *provider);GList * gda_provider_list (void);void gda_provider_free_list (GList *list);GdaProvider * gda_provider_find_by_name (constgchar *name);GList * gda_list_datasources (void);GList * gda_list_datasources_for_provider (gchar *name); #define GDA_DSN_GDA_NAME (dsn) #define GDA_DSN_PROVIDER (dsn) #define GDA_DSN_DSN (dsn) #define GDA_DSN_DESCRIPTION (dsn) #define GDA_DSN_USERNAME (dsn) #define GDA_DSN_CONFIG (dsn) #define gda_dsn_new ()void gda_dsn_free (GdaDsn *dsn);GdaDsn * gda_dsn_copy (GdaDsn *dsn);GdaDsn * gda_dsn_find_by_name (constgchar *dsn_name);void gda_dsn_set_name (GdaDsn *dsn, constgchar *name);void gda_dsn_set_provider (GdaDsn *dsn, constgchar *provider);void gda_dsn_set_dsn (GdaDsn *dsn, constgchar *dsn_str);void gda_dsn_set_description (GdaDsn *dsn, constgchar *description);void gda_dsn_set_username (GdaDsn *dsn, constgchar *username);void gda_dsn_set_config (GdaDsn *dsn, constgchar *config);void gda_dsn_set_global (GdaDsn *dsn,gboolean is_global);gboolean gda_dsn_save (GdaDsn *dsn);gboolean gda_dsn_remove (GdaDsn *dsn);GList * gda_dsn_list (void);void gda_dsn_free_list (GList *list);void gda_config_save_last_connection (constgchar *gda_name, constgchar *username);
This module provides an abstraction of all the access to the underlying configuration database. Currently, this means gda-config is just a wrapper around the GConf API, but we want to keep this design just in case we want later to change this (thus only having to change this module), as well as to allow other people to write their libgda implementations for other operating systems/environments.
#define GDA_CONFIG_SECTION_LAST_CONNECTIONS "/apps/gda/LastConnections"
#define GDA_CONFIG_KEY_MAX_LAST_CONNECTIONS "/apps/gda/MaxLastConnections"
gchar * gda_config_get_string (constgchar *path);
Gets the value of the specified configuration entry as a string. You are then responsible to free the returned string
path : | path to the configuration entry |
Returns : | the value stored at the given entry |
gint gda_config_get_int (constgchar *path);
Gets the value of the specified configuration entry as an integer
path : | path to the configuration entry |
Returns : | the value stored at the given entry |
gdouble gda_config_get_float (constgchar *path);
Gets the value of the specified configuration entry as a float
path : | path to the configuration entry |
Returns : | the value stored at the given entry |
gboolean gda_config_get_boolean (constgchar *path);
Gets the value of the specified configuration entry as a boolean
path : | path to the configuration entry |
Returns : | the value stored at the given entry |
void gda_config_set_string (constgchar *path, constgchar *new_value);
Sets the given configuration entry to contain a string
path : | path to the configuration entry |
new_value : | new value |
void gda_config_set_int (constgchar *path,gint new_value);
Sets the given configuration entry to contain an integer
path : | path to the configuration entry |
new_value : | new value |
void gda_config_set_float (constgchar *path,gdouble new_value);
Sets the given configuration entry to contain a float
path : | path to the configuration entry |
new_value : | new value |
void gda_config_set_boolean (constgchar *path,gboolean new_value);
Sets the given configuration entry to contain a boolean
path : | path to the configuration entry |
new_value : | new value |
void gda_config_remove_section (constgchar *path);
Remove the given section from the configuration database
path : | path to the configuration section |
void gda_config_remove_key (constgchar *path);
Remove the given entry from the configuration database
path : | path to the configuration entry |
gboolean gda_config_has_section (constgchar *path);
Checks whether the given section exists in the configuration system
path : | path to the configuration section |
Returns : | TRUE if the section exists, FALSE otherwise |
gboolean gda_config_has_key (constgchar *path);
Check whether the given key exists in the configuration system
path : | path to the configuration key |
Returns : | TRUE if the entry exists, FALSE otherwise |
void gda_config_commit (void);
Commits all changes made to the configuration system. This means that all buffered data (that is, modified data not yet written to the configuration database), if any, is actually written to disk
void gda_config_rollback (void);
Discards all changes made to the configuration system.
GList * gda_config_list_sections (constgchar *path);
Return a GList containing the names of all the sections available under the given root directory.
To free the returned value, you can use gda_config_free_list
path : | path for root dir |
Returns : | a list containing all the section names |
GList * gda_config_list_keys (constgchar *path);
Returns a list of all keys that exist under the given path.
To free the returned value, you can use gda_config_free_list
path : | path for root dir |
Returns : | a list containing all the key names |
void gda_config_free_list (GList *list);
Free all memory used by the given GList, which must be the return value from either gda_config_list_sections and gda_config_list_keys
list : | list to be freed |
#define GDA_PROVIDER_DSN_PARAMS(srv) ((srv) ? (srv)->dsn_params : NULL)
srv : |
|
GdaProvider * gda_provider_new (void);
Allocates memory for a new
Returns : | a pointer to a new |
GdaProvider * gda_provider_copy (GdaProvider *provider);
Make a deep copy of all the data needed to describe a GDA provider.
provider : | the provider to be copied. |
Returns : | a pointer to the newly allocated provider object |
void gda_provider_free (GdaProvider *provider);
Frees the memory allocated with gda_provider_new and the memory allocated to struct members.
provider : | the provider to de-allocate. |
GList * gda_provider_list (void);
Searches the CORBA database for GDA providers and returns a Glist of
Returns : | a GList of GDA providers structs |
void gda_provider_free_list (GList *list);
Frees a list of
list : | list of |
GdaProvider * gda_provider_find_by_name (constgchar *name);
Returns a
name : | provider name |
Returns : | a pointer to the provider structure, or NULL if not found |
GList * gda_list_datasources (void);
Lists all datasources configured on the system. You can then call gda_config_free_list to free the returned list
Returns : | a GList with the names of all data sources configured. |
GList * gda_list_datasources_for_provider (gchar *name);
Returns a list of the names of all data sources set up for the given provider.
name : | |
Returns : | a GList of all datasources available to a specific |
void gda_dsn_free (GdaDsn *dsn);
Release all memory occupied by the given
dsn : | data source |
GdaDsn * gda_dsn_copy (GdaDsn *dsn);
Make an exact copy of the given
dsn : | |
Returns : | the newly created |
GdaDsn * gda_dsn_find_by_name (constgchar *dsn_name);
Search in the database for the given data source, and return detailed information about it
dsn_name : | data source name |
Returns : | a |
void gda_dsn_set_name (GdaDsn *dsn, constgchar *name);
Set the name for the given
dsn : | data source |
name : | new data source name |
void gda_dsn_set_provider (GdaDsn *dsn, constgchar *provider);
Set the provider for the given
dsn : | data source |
provider : | provider name |
void gda_dsn_set_dsn (GdaDsn *dsn, constgchar *dsn_str);
Set the connection string for the given
For example, a connection string to connect to a PostgreSQL database might look like this:
"DATABASE=my_database;HOST=localhost
to connect to the database "my_database" at the local machine. On the other hand, a string for connecting a gda-default's database, might look like:
"DIRECTORY=/home/me/database"
dsn : | data source |
dsn_str : | DSN connection string |
void gda_dsn_set_description (GdaDsn *dsn, constgchar *description);
Set the description string for the given
dsn : | data source |
description : | DSN description for the given |
void gda_dsn_set_username (GdaDsn *dsn, constgchar *username);
Set the username for the given
dsn : | data source |
username : | user name |
void gda_dsn_set_config (GdaDsn *dsn, constgchar *config);
dsn : | data source |
config : | configurator |
void gda_dsn_set_global (GdaDsn *dsn,gboolean is_global);
dsn : | data source |
is_global : | global flag |
gboolean gda_dsn_save (GdaDsn *dsn);
Saves the given data source into the GDA configuration
dsn : | data source |
Returns : | TRUE if it was successful, FALSE if there was an error |
gboolean gda_dsn_remove (GdaDsn *dsn);
Remove the given data source (that is, the one described in the given
dsn : | data source |
Returns : | TRUE if it was successful, FALSE if there was an error |
GList * gda_dsn_list (void);
Returns a list of all available data sources. The returned value is
a GList of
Returns : | a list of |
void gda_dsn_free_list (GList *list);
Free the given list, which should be a list of
list : | the list to be freed |
void gda_config_save_last_connection (constgchar *gda_name, constgchar *username);
Adds an entry to the 'Last Connections' configuration section. This section is read by top level clients, such as the GnomeDbLogin widget in GNOME-DB to show the user a list of the last successful connections.
gda_name : | GDA connection name |
username : | user name used for the connection |
<<< gda-common | gda-corba >>> |