statsbiblioteket.harvest.synch package¶
Submodules¶
statsbiblioteket.harvest.synch.harvest_synch module¶
-
statsbiblioteket.harvest.synch.harvest_synch.
recreate
(session: sqlalchemy.orm.session.Session, cls: statsbiblioteket.harvest.harvest_types.HarvestType, objects: typing.Set, project_id=None, *criterion) → typing.Set[source]¶ Upserts the given objects in the database and removes any objects not given. To elaborate, all objects of the same type, matching the project_id, if given and any other criterion will be deleted, if they are not present in :param session: The database session :param cls: The class of the objects (which implicitly denote the sql table) :param objects: The objects to create :param project_id: The project id :param criterion: Other criterion for the delete :return: The updated objects