GetDKAN / dkan

DKAN Open Data Portal
https://dkan.readthedocs.io/en/latest/index.html
GNU General Public License v2.0
372 stars 171 forks source link

Apply table schemas on datastore import #3564

Open dafeder opened 3 years ago

dafeder commented 3 years ago

We want to support, through documentation and probably some helper classes added to the codebase, the application of basic column-level metadata (data type, description) at the moment of an import. For now this will need to be implemented via custom event listener on a per-site basis, but there should be an established pattern to create the listener and provide Drupal with table schema instructions to pass to the DB server based on Frictionless Table Schema field definitions. A helper class could be the best way to pass a single field definition, such as...

{}

... and get back the correct instructions for the Drupal schema API to apply to the table.

Examples coming...

dharizza commented 3 years ago

Created initial proof of concept, still in progress.

QA Steps

Pendant

dharizza commented 3 years ago

@dafeder I just fixed the issue of the table not being created by adding an extra function to do some mapping between types, in theory frictionless data tables have specific types and they not necessarily match the db types, so for testing I added one extra function that adds some mapping there. So there are two things to do: