qunicorn_core.db.database_services package

Submodules

qunicorn_core.db.database_services.db_service module

qunicorn_core.db.database_services.db_service.get_database_object(db_object_id: int, database_object_class: DbModel) DbModel

Gets a database object

Arguments:

db_object_id - id of the database object database_object_class - class of the database object

qunicorn_core.db.database_services.db_service.get_session()
qunicorn_core.db.database_services.db_service.remove_database_object(db_object: DbModel)

Deletes a database object, as long as it is a database-model

qunicorn_core.db.database_services.db_service.save_database_object(db_object: DbModel) DbModel

Creates or Updates a database object, as long as it is a database-model

qunicorn_core.db.database_services.db_service.save_device_by_name(device: DeviceDataclass)

Updates device object in database if is exists and creates new entry if it doesn’t exist

qunicorn_core.db.database_services.device_db_service module

qunicorn_core.db.database_services.device_db_service.get_device_with_name(provider_name: str) DeviceDataclass

Returns the default device of the provider with the name provider_name

qunicorn_core.db.database_services.job_db_service module

qunicorn_core.db.database_services.job_db_service.create_database_job(job_core: JobCoreDto)

Creates a database job with the given circuit and saves it in the database

qunicorn_core.db.database_services.job_db_service.get_job(job_id: int) JobDataclass

Gets the job with the job_id from the database

qunicorn_core.db.database_services.job_db_service.update_attribute(job_id: int, attribute_value, attribute_name)

Updates one attribute (attribute_name) of the job with the id job_id

qunicorn_core.db.database_services.job_db_service.update_finished_job(job_id: int, results: list[qunicorn_core.db.models.result.ResultDataclass], job_state: JobState = JobState.FINISHED)

Updates the attributes state and results of the job with the id job_id

Module contents