Open bedeho opened 3 years ago
As of today, variant types can't be too complex and reference an entity. At the database level, variant type fields are stored as JSONs in the respective entities columns. Unless we redesign this approach, we'd need to implement some non-trivial manipulation of these non-structured fields and it's hard to enforce PK constraints.
I thought you said that PostgreSQL had some very simple JSON aware filtering we could use, after all we are allowing such filtering on normal entity member fields that are unions? So isn't it just a matter of turning "invitedBy.AnotherPersonInvited.invitor" into some JSON equivalent and adding this into the WHERE
part of whatever SELECT
statement is powering the derivedFrom
.
An up front nice to have would be that when validating the input schema that the "invitedBy.AnotherPersonInvited.invitor" path actually matches some leaf node in the type tree of InvitationSource
which has the correct type Person
, and warn the user if not. But this would be the cherry on top.
How hard would this be to faciliate?