![]() |
![]() |
![]() |
GNOME Data Access 4.0 manual | ![]() |
---|---|---|---|---|
GdaConfig; GdaConfig* gda_config_get (void); GdaDataSourceInfo; GdaDataSourceInfo* gda_config_get_dsn (const gchar *dsn_name); gboolean gda_config_define_dsn (const GdaDataSourceInfo *info, GError **error); gboolean gda_config_remove_dsn (const gchar *dsn_name, GError **error); GdaDataModel* gda_config_list_dsn (void); gint gda_config_get_nb_dsn (void); gint gda_config_get_dsn_index (const gchar *dsn_name); GdaDataSourceInfo* gda_config_get_dsn_at_index (gint index); gboolean gda_config_can_modify_system_config (void); GdaProviderInfo; GdaProviderInfo* gda_config_get_provider_info (const gchar *provider_name); GdaServerProvider* gda_config_get_provider_object (const gchar *provider_name, GError **error); GdaDataModel* gda_config_list_providers (void);
"dsn-added" : Run First "dsn-changed" : Run First "dsn-removed" : Run First "dsn-to-be-removed" : Run First
The functions in this section allow applications an easy access to the libgda configuration, thus making them able to access the list of data sources configured in the system, for instance.
Upon initialization, a single instance GdaConfig object is created,
and no other will need to be created. A pointer to this object can be obtained with
gda_config_get()
.
GdaConfig* gda_config_get (void);
Get a pointer to the global GdaConfig object
Returns : | a non NULL pointer to a GdaConfig
|
typedef struct { gchar *name; gchar *provider; gchar *description; gchar *cnc_string; gchar *auth_string; gboolean is_system; } GdaDataSourceInfo;
GdaDataSourceInfo* gda_config_get_dsn (const gchar *dsn_name);
Get information about the DSN named dsn_name
dsn_name : |
the name of the DSN to look for |
Returns : | a a pointer to read-only GdaDataSourceInfo structure, or NULL if not found
|
gboolean gda_config_define_dsn (const GdaDataSourceInfo *info, GError **error);
Add or update a DSN from the definition in info
info : |
a pointer to a filled GdaDataSourceInfo structure |
error : |
a place to store errors, or NULL
|
Returns : | TRUE if no error occurred |
gboolean gda_config_remove_dsn (const gchar *dsn_name, GError **error);
Add or update a DSN from the definition in info
dsn_name : |
the name of the DSN to remove |
error : |
a place to store errors, or NULL
|
Returns : | TRUE if no error occurred |
GdaDataModel* gda_config_list_dsn (void);
Get a GdaDataModel representing all the configured DSN, and keeping itself up to date with the changes in the declared DSN.
The returned data model is composed of the following columns:
DSN name
Provider name
Description
Connection string
Username if it exists
Returns : | a new GdaDataModel |
gint gda_config_get_nb_dsn (void);
Get the number of defined DSN
Return: the number of defined DSN
Returns : |
gint gda_config_get_dsn_index (const gchar *dsn_name);
Get the index (starting at 0) of the DSN named dsn_name
dsn_name : |
|
Returns : | the index or -1 if not found |
GdaDataSourceInfo* gda_config_get_dsn_at_index (gint index);
Get a pointer to a read-only GdaDataSourceInfo at the index
position
index : |
|
Returns : | the pointer or NULL if no DSN exists at position index
|
gboolean gda_config_can_modify_system_config (void);
Tells if the global (system) configuration can be modified (considering system permissions and settings)
Returns : | TRUE if system-wide configuration can be modified |
typedef struct { gchar *id; gchar *location; gchar *description; GdaSet *dsn_params; /* Specs to create a DSN */ GdaSet *auth_params; /* Specs to authenticate a client */ } GdaProviderInfo;
GdaProviderInfo* gda_config_get_provider_info (const gchar *provider_name);
Get some information about the a database provider (adaptator) named
provider_name
provider_name : |
|
Returns : | a pointer to read-only GdaProviderInfo structure, or NULL if not found
|
GdaServerProvider* gda_config_get_provider_object (const gchar *provider_name, GError **error);
Get a pointer to the session-wide GdaServerProvider for the
provider named provider_name
provider_name : |
|
error : |
a place to store errors, or NULL
|
Returns : | a pointer to the GdaServerProvider, or NULL if an error occurred
|
GdaDataModel* gda_config_list_providers (void);
Get a GdaDataModel representing all the installed database providers.
The returned data model is composed of the following columns:
Provider name
Description
DSN parameters
Authentification parameters
File
Returns : | a new GdaDataModel |
void user_function (GdaConfig *gdaconfig, gpointer arg1, gpointer user_data) : Run First
gdaconfig : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (GdaConfig *gdaconfig, gpointer arg1, gpointer user_data) : Run First
gdaconfig : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (GdaConfig *gdaconfig, gpointer arg1, gpointer user_data) : Run First
gdaconfig : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |
void user_function (GdaConfig *gdaconfig, gpointer arg1, gpointer user_data) : Run First
gdaconfig : |
the object which received the signal. |
arg1 : |
|
user_data : |
user data set when the signal handler was connected. |