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

Table API query/get all rewrite #84

Merged
merged 27 commits into from
Nov 25, 2020
Merged

Table API query/get all rewrite #84

merged 27 commits into from
Nov 25, 2020

Conversation

MindFlavor
Copy link
Contributor

@MindFlavor MindFlavor commented Nov 16, 2020

A proposal to address #83.

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

Some(States::Init),
move |state: Option<States>| async move {
log::debug!("state == {:?}", state);
let response = match state {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe match state? would make the code a little less verbose.

sdk/storage/src/table/cloud_table.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/cloud_table.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/continuation_token.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/continuation_token.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/query_result.rs Outdated Show resolved Hide resolved
@MindFlavor MindFlavor marked this pull request as ready for review November 18, 2020 14:08
Copy link
Contributor

@Alexei-B Alexei-B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fulfils #83 nicely but I think it may have a couple typos and the dummy URL leaking out of the public interface of ContinuationToken is a bit strange.

sdk/storage/src/table/continuation_token.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/continuation_token.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/cloud_table.rs Outdated Show resolved Hide resolved
sdk/storage/src/table/continuation_token.rs Show resolved Hide resolved
pub continuation_token: Option<ContinuationToken>,
}

impl<T> std::convert::TryFrom<(url::Url, &HeaderMap, &body::Bytes)> for QueryResult<T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always find conversion methods from tuples to be very confusing unless it's an extremely obvious one like (f32, f32) to Point. Is there a better way to model this?

}
}

impl std::convert::From<(Url, ResponseFuture)> for PerformRequestResponse {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I like this. I think I'd prefer a PerformRequestResponse::new function. Tuples are best for data that is extremely obviously related to one another, which is not the case here. The new function will be a bit easier to understand.

Copy link
Contributor

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I have some nits, but feel free to merge and we can address those later.

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

3 participants