Gda.Config¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
File to use for system-wide DSN list |
||
r/w |
File to use for per-user DSN list |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Gets emitted whenever a new DSN has been defined |
|
Gets emitted whenever a DSN’s definition has been changed |
|
Gets emitted whenever a DSN has been removed |
|
Gets emitted whenever a DSN is about to be removed |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
object |
r |
Class Details¶
- class Gda.Config(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod can_modify_system_config()¶
-
Tells if the global (system) configuration can be modified (considering system permissions and settings)
- classmethod define_dsn(info)¶
- Parameters:
info (
Gda.DsnInfo) – a pointer to a filledGda.DsnInfostructure- Raises:
- Returns:
Trueif no error occurred- Return type:
Add or update a DSN from the definition in info.
This method may fail with a %GDA_CONFIG_ERROR domain error (see the
Gda.ConfigErrorerror codes).
- classmethod dsn_needs_authentication(dsn_name)¶
- Parameters:
dsn_name (
str) – the name of a DSN, in the “[<username>[:<password>]@]<DSN>” format- Returns:
Trueif an authentication is needed- Return type:
Tells if the data source identified as dsn_name needs any authentication. If a <username> and optionally a <password> are specified, they are ignored.
- classmethod get()¶
- Returns:
a non
Nonepointer to the uniqueGda.Config- Return type:
Get a pointer to the global (unique)
Gda.Configobject. This functions increments the reference count of the object, so you need to callGObject.Object.unref() on it once finished.
- classmethod get_dsn_info(dsn_name)¶
- Parameters:
dsn_name (
str) – the name of the DSN to look for- Returns:
a pointer to read-only
Gda.DsnInfostructure, orNoneif not found- Return type:
Get information about the DSN named dsn_name.
dsn_name's format is “[<username>[:<password>]@]<DSN>” (if <username> and optionally <password> are provided, they are ignored). Also see the
Gda.dsn_split() utility function.
- classmethod get_dsn_info_at_index(index)¶
- Parameters:
index (
int) – an index- Returns:
the pointer or
Noneif no DSN exists at position index- Return type:
Get a pointer to a read-only
Gda.DsnInfoat the index position
- classmethod get_dsn_info_index(dsn_name)¶
-
Get the index (starting at 0) of the DSN named dsn_name
- classmethod get_nb_dsn()¶
- Returns:
the number of defined DSN
- Return type:
Get the number of defined DSN
- classmethod get_provider(provider_name)¶
- Parameters:
provider_name (
str) – a database provider- Raises:
- Returns:
a pointer to the
Gda.ServerProvider, orNoneif an error occurred- Return type:
Get a pointer to the session-wide
Gda.ServerProviderfor the provider named provider_name. The caller must not callGObject.Object.unref() on the returned object.This method may fail with a %GDA_CONFIG_ERROR domain error (see the
Gda.ConfigErrorerror codes).
- classmethod get_provider_info(provider_name)¶
- Parameters:
provider_name (
str) – a database provider- Returns:
a pointer to read-only
Gda.ProviderInfostructure, orNoneif not found- Return type:
Get some information about the a database provider (adapter) named
- classmethod list_dsn()¶
- Returns:
a new
Gda.DataModel- Return type:
Get a
Gda.DataModelrepresenting 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
- classmethod list_providers()¶
- Returns:
a new
Gda.DataModel- Return type:
Get a
Gda.DataModelrepresenting all the installed database providers.The returned data model is composed of the following columns:
Provider name
Description
DSN parameters
Authentication parameters
File name of the plugin
- classmethod remove_dsn(dsn_name)¶
- Parameters:
dsn_name (
str) – the name of the DSN to remove- Raises:
- Returns:
Trueif no error occurred- Return type:
Remove the DSN named dsn_name.
This method may fail with a %GDA_CONFIG_ERROR domain error (see the
Gda.ConfigErrorerror codes).
- do_dsn_added(new_dsn) virtual¶
- Parameters:
new_dsn (
Gda.DsnInfo) –
- do_dsn_changed(dsn) virtual¶
- Parameters:
dsn (
Gda.DsnInfo) –
- do_dsn_removed(old_dsn) virtual¶
- Parameters:
old_dsn (
Gda.DsnInfo) –
- do_dsn_to_be_removed(old_dsn) virtual¶
- Parameters:
old_dsn (
Gda.DsnInfo) –
Signal Details¶
- Gda.Config.signals.dsn_added(config, new_dsn)¶
- Signal Name:
dsn-added- Flags:
- Parameters:
config (
Gda.Config) – The object which received the signalnew_dsn (
objectorNone) – aGda.DsnInfo
Gets emitted whenever a new DSN has been defined
- Gda.Config.signals.dsn_changed(config, dsn)¶
- Signal Name:
dsn-changed- Flags:
- Parameters:
config (
Gda.Config) – The object which received the signaldsn (
objectorNone) – aGda.DsnInfo
Gets emitted whenever a DSN’s definition has been changed
- Gda.Config.signals.dsn_removed(config, old_dsn)¶
- Signal Name:
dsn-removed- Flags:
- Parameters:
config (
Gda.Config) – The object which received the signalold_dsn (
objectorNone) – aGda.DsnInfo
Gets emitted whenever a DSN has been removed
- Gda.Config.signals.dsn_to_be_removed(config, old_dsn)¶
- Signal Name:
dsn-to-be-removed- Flags:
- Parameters:
config (
Gda.Config) – The object which received the signalold_dsn (
objectorNone) – aGda.DsnInfo
Gets emitted whenever a DSN is about to be removed
Property Details¶
- Gda.Config.props.system_filename¶
-
File to use for system-wide DSN list. When changed, the whole list of DSN will be reloaded.