ads.database package

Submodules

ads.database.connection module

class ads.database.connection.Connector(secret_id: str | None = None, key: str | None = None, repository_path: str | None = None, **kwargs)[source]

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 = “example-password”.

Return type:

A Connector object.

connect()[source]
class ads.database.connection.OracleConnector(oracle_connection_config)[source]

Bases: object

ads.database.connection.get_repository(key: str, repository_path: str | None = None) dict[source]

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: str | None = None) None[source]

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: str | None = None) dict[source]

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.

Module contents