Hi,
I’m currently trying out a few things with Akka Serverless with a simple service for user management. I want to be able to retrieve users by name.
Having used ScalaPB in other projects, I used a wrapper class of google/protobuf/wrappers.proto
to generate an entity class where last_name
is mandatory, and first_name
is an optional field, and this all works fine and as expected
But given a UserView message like this:
message UserView {
string id = 1;
string last_name = 2;
google.protobuf.StringValue first_name = 3;
}
and a view query which returns a message with a repeated UserView field and a boolean value if there are more users as follows
rpc Search(SearchUsers) returns (UserResults) {
option (akkaserverless.method).view.query = {
query: "SELECT * AS users, has_more() AS more_users FROM users WHERE first_name = :name OR last_name = :name OFFSET :start_from LIMIT :page_size"
};
}
The call fails with a java.lang.RuntimeException: Unsupported key part class com.google.protobuf.DynamicMessage
root cause.
If I remove the first_name = :name
clause, or change the type of the first_name
field to string
it works fine though. Is there another way I could implement the same functionality, or is there no supported mechanism for something like this yet?
As a side note, I’ve seen a topic on the forums for this feature request, but a LIKE comparison operator would be greatly appreciated (As would a lower case function for case insensitive searches, but I can work around that for now with an action controller and transforming the view properties to lower case)