-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: support async getters/setters #397
Comments
I have a similar requirement, I think, where I want to combine multiple primitive fields (string/number/boolean) into one single object (map) after it was read from the database. I assume it's a common issue to break apart an object into it's primitive constituents to be able to use these on primary and secondary indexes. Therefore, it would be very useful to have getters and setter also on the entity-level rather than just on attribute-level. |
@nhomble I have also considered this, namely something like @zirkelc An item level getter/setter would most likely to come as an execution option to |
Could I add my vote for async validation? :) |
Could electrodb be extended to support get/set hooks (prewrite and postread) to allow async functions?
Since the async part of it implies some more latency, I think it would be reasonable to only call these transformations once per write or read. Maybe to avoid confusion with existing get/set, we could just call these transformers or converters.
A common use case would be to transform certain fields in the schema as requiring a common encryption or hashing transformation prior to write. Conversely on the read, a similar transformation would be needed to decrypt the data.
The async part of it comes in when you have more complicated key retrieval strategies such that you need to retrieve the key per payload.
The text was updated successfully, but these errors were encountered: