Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-346

Always sync _id and jsonb->>'id' using a trigger, drop "populateJsonWithId: false" option

    XMLWordPrintable

Details

    • CP: sprint 63, CP: sprint 64
    • 2
    • Core: Platform

    Description

      CQL2PG optimizes any jsonb->>'id' query to use the primary key _id value instead:
      https://github.com/folio-org/cql2pgjson-java/tree/master/cql2pgjson#id

      This fails if _id and jsonb->>'id' are different. There is no automatic syncing. A module must explicitly add "populateJsonWithId": true to the post tenant API schema.json:
      https://github.com/folio-org/raml-module-builder/tree/v23.11.0#the-post-tenant-api

      If that entry is missing or set to false any code and any SQL access must ensure that _id and jsonb->>'id' are in sync. This is error-prone and should better be handled by a database trigger.

      Solution: Always add this trigger and remove the option from schema.json.

      This should be implemented at the same time as RMB-347 (and RMB-277 if we come to an consensus).

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases