dkan icon indicating copy to clipboard operation
dkan copied to clipboard

Rename resource class

Open dafeder opened this issue 2 years ago • 0 comments

This PR:

  • Renames the Resource class in DKAN common to DataResource.
  • Brings the entire datastore library into DKAN core and renames its Resource class to DatastoreResource

This addresses two issues:

  1. That resource is considered a reserved word now in PHP and classes should not have that name anymore.
  2. That having a separate "datastore" library, which seemed useful early in the DKAN 2 dev cycle, has turned out to be a burden with few benefits.

There are issues of unnecessary complexity that bringing the datastore library inside DKAN does not solve, but at least it simplifies the codebase and dependency issues. Later we should simplify more of the import and storage code.

The refactoring got a bit out of control and I ended up also removing the SqlStorageTrait (only used by one class) and the StorageInterface (at the moment, redundant with DatabaseTableInterface).

One problem: There is a unit test that moved in from the datastore library, which tests the ImportJob class, which is very slow. Need to find a way to speed this up or replace.

dafeder avatar Aug 09 '22 15:08 dafeder