colda.database.strategy package

Submodules

colda.database.strategy.abstract_database_strategy module

class colda.database.strategy.abstract_database_strategy.AbstractDatabaseStrategy

Bases: ABC

abstract get_all_records_history(**kwargs)
abstract classmethod get_instance()
abstract get_record(**kwargs)
abstract store_record(**kwargs)

colda.database.strategy.api module

class colda.database.strategy.api.DatabaseOperator

Bases: AbstractDatabaseStrategy, BaseDatabaseStrategy

Strategy pattern to manage db

Attributes

database

Methods

set_database get_all_records_history store_record get_record

property database

Get strategy object

Returns

Any

get_all_records_history(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

classmethod get_instance() DatabaseOperator

Singleton pattern. Get instance of current class.

Returns

DatabaseOperator

get_record(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

set_database(database_type: Literal['default_metadata', 'train_sponsor_metadata', 'train_assistor_metadata', 'train_algorithm'] | Literal['default_metadatatest_sponsor_metadata', 'test_assistor_metadata', 'test_algorithm']) None

Helper function to set strategy object

Parameters

database_type : Union[Train_Database_Type, Test_Database_Type]

Returns

None

store_record(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

colda.database.strategy.base module

class colda.database.strategy.base.BaseDatabaseStrategy

Bases: object

Base class for database strategy pattern

final placeholder(**kwargs)

colda.database.strategy.database_strategy module

class colda.database.strategy.database_strategy.DatabaseOperator

Bases: AbstractDatabaseStrategy, BaseDatabaseStrategy

Strategy pattern to manage db

Attributes

database

Methods

set_database get_all_records_history store_record get_record

property database

Get strategy object

Returns

Any

get_all_records_history(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

classmethod get_instance() DatabaseOperator

Singleton pattern. Get instance of current class.

Returns

DatabaseOperator

get_record(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

set_database(database_type: Literal['default_metadata', 'train_sponsor_metadata', 'train_assistor_metadata', 'train_algorithm'] | Literal['default_metadatatest_sponsor_metadata', 'test_assistor_metadata', 'test_algorithm']) None

Helper function to set strategy object

Parameters

database_type : Union[Train_Database_Type, Test_Database_Type]

Returns

None

store_record(**kwargs) list

call specific function

Parameters

**kwargs : Any

Returns

list

Module contents