Details
-
New Feature
-
Status: Open (View Workflow)
-
P3
-
Resolution: Unresolved
-
None
-
None
-
customfield_11100 38316
-
CP: Non-roadmap backlog
-
Core: Platform
Description
Some institutions need to bulk update the user records with data from the central administration. Only some fields of user records should be updated.
MODKBEKBJ-447 has already implemented a PATCH.
There are other use cases.
UPDATE users SET jsonb = jsonb_set(jsonb_set(jsonb, '{active}', 'true'), '{patronGroup}', '4bb563d9-3f9d-4e1e-8d1d-04e75666d68f') WHERE id = '7261ecaae3a74dc68b468e12a70b1aec';
This sets "active" and "patronGroup" only, all other properties remain unchanged.
PostgreSQL has the - operator to delete a jsonb property, and PostgreSQL 13 has the jsonb_set_lax function that also can delete nested jsonb properties.
RMB has a method that can update a single jsonb property using jsonb_set: https://github.com/folio-org/raml-module-builder/blob/v30.2.4/domain-models-runtime/src/main/java/org/folio/rest/persist/PostgresClient.java#L1325-L1360
Task:
Create a PostgresClient method that can update and/or delete multiple jsonb properties.
Create a PgUtil PATCH method that uses it.
TestRail: Results
Attachments
Issue Links
- relates to
-
FOLIO-2028 SPIKE: how to handle update conflicts?
-
- Closed
-
-
MODKBEKBJ-447 Support PATCH /eholdings/kb-credentials{credentialsId} to partially update existing KB credentials entry
-
- Closed
-
-
RMB-388 PostgresClient.getById with transaction, with "SELECT … FOR UPDATE"
-
- Closed
-
-
UXPROD-1752 Prevent update conflicts (via optimistic locking): platform support for detection
-
- Closed
-
-
UXPROD-2796 Prevent update conflicts when doing manual edits (User A and User B)
-
- Closed
-
-
UXPROD-2797 Prevent update conflicts (1 user and system trying to act on the same record)
-
- Closed
-
-
UXPROD-2798 Prevent update conflicts (two automated processes acting on the same record)
-
- Closed
-