Skip to content
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

Merged
merged 5 commits into from Feb 14, 2023

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Feb 13, 2023

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

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>
@michelleN michelleN added this to the v0.9.0 milestone Feb 13, 2023
@dicej
Copy link
Contributor Author

dicej commented Feb 13, 2023

FYI, the CI failure is due to the dreaded "no space left on device" issue running the E2E tests on Windows.

@radu-matei
Copy link
Member

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>,

Copy link
Collaborator

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.

crates/outbound-redis/src/lib.rs Outdated Show resolved Hide resolved
wit/ephemeral/redis-types.wit Outdated Show resolved Hide resolved
Co-authored-by: itowlson <github@hestia.cc>
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
wit/ephemeral/redis-types.wit Outdated Show resolved Hide resolved
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>
@dicej dicej merged commit 3c811c6 into fermyon:main Feb 14, 2023
@dicej dicej deleted the redis-execute branch February 14, 2023 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants