libgda API reference | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
#define GDA_CONFIG_SECTION_DATASOURCES #define GDA_CONFIG_SECTION_LAST_CONNECTIONS #define GDA_CONFIG_SECTION_LOG #define GDA_CONFIG_KEY_MAX_LAST_CONNECTIONS gchar* gda_config_get_string (const gchar *path); gint gda_config_get_int (const gchar *path); gdouble gda_config_get_float (const gchar *path); gboolean gda_config_get_boolean (const gchar *path); void gda_config_set_string (const gchar *path, const gchar *new_value); void gda_config_set_int (const gchar *path, gint new_value); void gda_config_set_float (const gchar *path, gdouble new_value); void gda_config_set_boolean (const gchar *path, gboolean new_value); void gda_config_remove_section (const gchar *path); void gda_config_remove_key (const gchar *path); gboolean gda_config_has_section (const gchar *path); gboolean gda_config_has_key (const gchar *path); void gda_config_commit (void); void gda_config_rollback (void); GList* gda_config_list_sections (const gchar *path); GList* gda_config_list_keys (const gchar *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 (const gchar *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 (const gchar *dsn_name); void gda_dsn_set_name (GdaDsn *dsn, const gchar *name); void gda_dsn_set_provider (GdaDsn *dsn, const gchar *provider); void gda_dsn_set_dsn (GdaDsn *dsn, const gchar *dsn_str); void gda_dsn_set_description (GdaDsn *dsn, const gchar *description); void gda_dsn_set_username (GdaDsn *dsn, const gchar *username); void gda_dsn_set_config (GdaDsn *dsn, const gchar *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 (const gchar *gda_name, const gchar *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 (const gchar *path); |
Gets the value of the specified configuration entry as a string. You are then responsible to free the returned string
gint gda_config_get_int (const gchar *path); |
Gets the value of the specified configuration entry as an integer
gdouble gda_config_get_float (const gchar *path); |
Gets the value of the specified configuration entry as a float
gboolean gda_config_get_boolean (const gchar *path); |
Gets the value of the specified configuration entry as a boolean
void gda_config_set_string (const gchar *path, const gchar *new_value); |
Sets the given configuration entry to contain a string
void gda_config_set_int (const gchar *path, gint new_value); |
Sets the given configuration entry to contain an integer
void gda_config_set_float (const gchar *path, gdouble new_value); |
Sets the given configuration entry to contain a float
void gda_config_set_boolean (const gchar *path, gboolean new_value); |
Sets the given configuration entry to contain a boolean
void gda_config_remove_section (const gchar *path); |
Remove the given section from the configuration database
void gda_config_remove_key (const gchar *path); |
Remove the given entry from the configuration database
gboolean gda_config_has_section (const gchar *path); |
Checks whether the given section exists in the configuration system
gboolean gda_config_has_key (const gchar *path); |
Check whether the given key exists in the configuration system
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 (const gchar *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
GList* gda_config_list_keys (const gchar *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
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
GdaProvider* gda_provider_new (void); |
Allocates memory for a new GdaProvider object and initializes struct members.
GdaProvider* gda_provider_copy (GdaProvider *provider); |
Make a deep copy of all the data needed to describe a GDA provider.
void gda_provider_free (GdaProvider *provider); |
Frees the memory allocated with gda_provider_new and the memory allocated to struct members.
GList* gda_provider_list (void); |
Searches the CORBA database for GDA providers and returns a Glist of GdaProvider structs.
void gda_provider_free_list (GList *list); |
Frees a list of GdaProvider structures previously returned by a call to gda_provider_list
GdaProvider* gda_provider_find_by_name (const gchar *name); |
Returns a GdaProvider structure describing the given provider. This function searches all the providers present on your system and tries to find the specified provider.
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
GList* gda_list_datasources_for_provider (gchar *name); |
Returns a list of the names of all data sources set up for the given provider.
void gda_dsn_free (GdaDsn *dsn); |
Release all memory occupied by the given GdaDsn structure
GdaDsn* gda_dsn_find_by_name (const gchar *dsn_name); |
Search in the database for the given data source, and return detailed information about it
void gda_dsn_set_name (GdaDsn *dsn, const gchar *name); |
Set the name for the given GdaDsn structure
void gda_dsn_set_provider (GdaDsn *dsn, const gchar *provider); |
Set the provider for the given GdaDsn structure
void gda_dsn_set_dsn (GdaDsn *dsn, const gchar *dsn_str); |
Set the connection string for the given GdaDsn structure. This string is DBMS-independent, so you must take care when filling it in. The best way to guess about the allowed parameters in this string for each provider is to obtain the GdaProvider structure for the provider you want to use, and query the list of available parameters by calling the GDA_PROVIDER_DSN_PARAMS macro, which returns a GList on which each node is a string containing the name of one parameter.
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"
void gda_dsn_set_description (GdaDsn *dsn, const gchar *description); |
Set the description string for the given GdaDsn structure.
void gda_dsn_set_username (GdaDsn *dsn, const gchar *username); |
Set the username for the given GdaDsn structure. When using this, the gda-client library would use this user name when you try to connect to this data source without specifying a user name in the call to gda_connection_open
gboolean gda_dsn_save (GdaDsn *dsn); |
Saves the given data source into the GDA configuration
gboolean gda_dsn_remove (GdaDsn *dsn); |
Remove the given data source (that is, the one described in the given GdaDsn structure) from the configuration database
GList* gda_dsn_list (void); |
Returns a list of all available data sources. The returned value is a GList of GdaDsn structures
void gda_dsn_free_list (GList *list); |
Free the given list, which should be a list of GdaDsn structures, as returned by gda_dsn_list
void gda_config_save_last_connection (const gchar *gda_name, const gchar *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.