ads.database package
Subpackages
Submodules
ads.database.connection module
- class ads.database.connection.Connector(secret_id: Optional[str] = None, key: Optional[str] = None, repository_path: Optional[str] = None, **kwargs)
Bases:
object
Validate that a connection could be made for the given set of connection parameters, and contruct a Connector object provided that the validation is successful.
- Parameters
secret_id (str, optional) – The ocid of the secret to retrieve from Oracle Cloud Infrastructure Vault.
key (str, optional) – The key to find the database directory.
repository_path (str, optional) – The local database information store, default to ~/.database unless specified otherwise.
kwargs (dict, optional) – Name-value pairs that are to be added to the list of connection parameters. For example, database_name=”mydb”, database_type=”oracle”, username = “root”, password = “pwd”.
- Return type
A Connector object.
- connect()
- class ads.database.connection.OracleConnector(oracle_connection_config)
Bases:
object
- ads.database.connection.get_repository(key: str, repository_path: Optional[str] = None) dict
Get all values from local database store.
- Parameters
key (str) – The key to find the database directory.
repository_path (str, optional) – The path to local database store, default to ~/.database unless specified otherwise.
- Return type
A dictionary of all values in the store.
- ads.database.connection.import_wallet(wallet_path: str, key: str, repository_path: Optional[str] = None) None
Saves wallet to local database store. Unzip the wallet zip file, update sqlnet.ora and store wallet files.
- Parameters
wallet_path (str) – The local path to the downloaded wallet zip file.
key (str) – The key to find the database directory.
repository_path (str, optional) – The local database store, default to ~/.database unless specified otherwise.
- ads.database.connection.update_repository(value: dict, key: str, replace: bool = True, repository_path: Optional[str] = None) dict
Saves value into local database store.
- Parameters
value (dict) – The values to store locally.
key (str) – The key to find the local database directory.
replace (bool, default to True) – If set to false, updates the stored value.
repository_path (str: str, optional) – The local database store, default to ~/.database unless specified otherwise.
- Return type
A dictionary of all values in the repository for the given key.