Record Layer Primary Key Prefixes

I have the option set in protobuf for a primary key:

calling loadRecord with a plain Tuple.from($email) is loading the record, which is unexpected (how does it know which primary key to append?)

What is the proper usage for explicit primary key prefixes? Thanks.

I would expect

Record type UserEmailRecord must have a primary key

based on just the snippet here, which does not even show the whole message.

One possible explanation for not getting an error is that UserEmailRecord isn’t included in the RecordTypeUnion and the loaded record is some other type altogether.

There is currently no way in just the .proto to get a compound primary key. It might not be unreasonable to deduce from the record type having a record type key that [(field).primary_key = true] should mean that it gets recordType() plus that. But that would be an enhancement. You probably need to use RecordMetaDataBuilder and setPrimaryKey.

1 Like