-
Notifications
You must be signed in to change notification settings - Fork 252
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
Finish Cosmos database client #455
Conversation
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.
Thank you 💯
use azure_core::collect_pinned_stream; | ||
use azure_core::headers::{continuation_token_from_headers_optional, session_token_from_headers}; | ||
use azure_core::prelude::*; | ||
use azure_core::Request as HttpRequest; |
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.
Should we rename them to HttpRequest
in Core (in another PR?
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.
Sounds good. I made an issue for this: #462
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.
Good work! ❤️
) -> crate::Result<DeleteDatabaseResponse> { | ||
let mut request = self | ||
.cosmos_client() | ||
.prepare_request_pipeline(&format!("dbs/{}", self.database_name()), http::Method::GET); |
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.
We should probably escape the resources (in this case the db name) at some point. To conform with other SDKs we should not validate the name (we decided to leave it to Azure) but improperly escaped URIs can cause trouble and can have security implications.
I've created #459 to track this.
649962b
to
20c8f14
Compare
) -> crate::Result<DeleteDatabaseResponse> { | ||
let mut request = self | ||
.cosmos_client() | ||
.prepare_request_pipeline(&format!("dbs/{}", self.database_name()), http::Method::GET); |
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.
This GETs the database, it doesn't delete it at all!
Will be fixed in #375 once we catch up with main
and update that MR, if you don't get to it first.
This moves the remaining operations in the Comsos database client over to the pipeline architecture.
It also expands a test to exercise listing collections and deleting a database. Happily, this prevented a bug from being checked in. 😊