caltechlibrary / irdmtools

A Go and Python package for working with InvenioRDM repositories.
https://caltechlibrary.github.io/irdmtools
Other
1 stars 1 forks source link

.created, .updated populating with "0001-01-01T00:00:00Z" by rdmutil #58

Closed rsdoiel closed 11 months ago

rsdoiel commented 11 months ago

Note sure if this is an issue in irdmtools or in the simplified package. The Record.Created and Record.Updated values are always showing up as "0001-01-01T00:00:00Z" even though the actual RDM REST API reports real timestamps.

rsdoiel commented 11 months ago

The problem seems to be related to storing the JSON in a database (testing with Postgres) and then retrieving it as part of the JSON value.

rsdoiel commented 11 months ago

Looks like need to compose the object I want so that the created, updated values in rdm_records_metadata are picked up for .created, .updated values when using direct Postgres access to build the JSON to store in a ds collection.

rsdoiel commented 11 months ago

The problem is in invenio_api.go. I need to come up with the right jsonb_* clauses to build the object I need including the handling of the timestamps withouy the time zone info.

rsdoiel commented 11 months ago

This turned out to be an issue with getting the Postgres SQL right so that it aligned with the JSON expectations when parsing the resulting record our data structure. Will be fixed in upcoming v0.0.56 release.