database.manage_database#
- autoclean.utils.database.manage_database(operation, run_record=None, update_record=None)[source]#
Manage database operations with thread safety.
- Parameters:
- operation
str
Operations can be:
create_collection: Create a new collection.
store: Store a new record.
update: Update an existing record.
update_status: Update the status of an existing record.
drop_collection: Drop the collection.
get_collection: Get the collection.
get_record: Get a record from the collection.
- run_record
dict
The record to store.
- update_record
dict
The record updates.
- operation
- Returns:
Any
Operation-specific return value.