Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
create or replace view {tenant id}_mod_oai_pmh.get_deleted_instances
as
select *
from {tenant id}_mod_inventory_storage.audit_instance inst
where 
inst.instance_updated_date <= {tenant id}_mod_inventory_storage.dateOrMax(timestamptz '{date_from}') // optional
and
inst.instance_updated_date >= {tenant id}_mod_inventory_storage.dateOrMin(timestamptz '{date_until}') // optional
and
coalesce(inst.suppress_from_discovery_srs, inst.suppress_from_discovery_inventory) = false; // optional

This view can be used along with AbstractGetRecordsHelper#requestFromInventory(...) method to search for deleted instances if deletedRecordsSupport=true and append them to the final result. Depending on the parameters, date_from, date_until and discovey_suppress may or may not be used in the view. Like in this spike, for the deleted instances the QueryBuilder can be applied as well to build this view, either separately (new QueryBuilder to handle only deleted instances), or in scope of the existing QueryBuilder by adding functionality to handle only deleted instances. However, last variant does not make sense once the new approach for OAI-PMH is implemented since it covers support for deleted instances. In this case, deleted instances support can be postponed until MODOAIPMH-490, MODOAIPMH-491 and MODOAIPMH-492 are completed.