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
add general-purpose execute
function to outbound-redis
#1134
Conversation
By popular request, this function should allow executing any arbitrary Redis command and retrieving its result, if any. Ideally, we'd support a statically typed interface for every command, but that would be a pretty huge effort, so we settle for dynamic typing for now. Once we have TCP socket support, users will be able to use their favorite Redis client library and enjoy static typing at that level, if applicable. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
FYI, the CI failure is due to the dreaded "no space left on device" issue running the E2E tests on Windows. |
Really love to see the addition of this, thanks for taking it on. Do we need a checklist for keeping track of other changes outside of this repo? Specifically thinking about other SDKs. |
@@ -76,6 +77,15 @@ pub struct RedisReport { | |||
/// "baz"))` as the result. The host will assert that said function is called exactly once with the specified | |||
/// arguments. | |||
pub smembers: Result<(), String>, | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a total aside, it would be interesting to run these conformance tests under tarpaulin.
Co-authored-by: itowlson <github@hestia.cc> Signed-off-by: Joel Dice <joel.dice@fermyon.com>
The `nil` case doesn't make sense for parameters, and string arguments have different interpretations than Redis status results, so they should have different name. This also renames cases to be consistent with the names in the database WIT files and with the semantics of Redis status messages. The name `redis-result` is admittedly somewhat verbose, but I wanted to avoid clashing with Rust's `Result` type and also the HTTP `Response` type, which didn't leave me with any natural, succinct names. And, to be consistent, I went with `redis-parameter` for the other type. Naming is hard. Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
By popular request, this function should allow executing any arbitrary Redis command and retrieving its result, if any. Ideally, we'd support a statically typed interface for every command, but that would be a pretty huge effort, so we settle for dynamic typing for now. Once we have TCP socket support, users will be able to use their favorite Redis client library and enjoy static typing at that level, if applicable.
Signed-off-by: Joel Dice joel.dice@fermyon.com