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

Scripts: Adds Stream APIs for CRUD Operations #4978

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

NaluTripician
Copy link
Contributor

Pull Request Template

Description

Adds new Stream APIs for CRUD operations on stored procedures, triggers, and user defined functions in the Scripts namespace.

Type of change

Please delete options that are not relevant.

  • [] New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #4951

/// <param name="cancellationToken"></param>
/// <returns>A <see cref="Task"/> containing a <see cref="ResponseMessage"/> containing the created stored procedure</returns>
public abstract Task<ResponseMessage> CreateStoredProcedureStreamAsync(
Stream streamPayload,
Copy link
Member

Choose a reason for hiding this comment

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

Metadata stream API's take the types themselves, as service don't accept any arbitrary payloads. please update all API's

/// <returns>A <see cref="Task"/> containing a <see cref="ResponseMessage"/> containing the created stored procedure</returns>
public abstract Task<ResponseMessage> CreateStoredProcedureStreamAsync(
Stream streamPayload,
string id,
Copy link
Member

Choose a reason for hiding this comment

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

What is 'id' for?

/// <summary>
/// Creates a stored procedure as an asynchronous operation in the Azure Cosmos DB service.
/// </summary>
/// <param name="streamPayload"></param>
Copy link
Member

Choose a reason for hiding this comment

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

Please expand with documentation and also a code usage sample.

/// <returns>A <see cref="Task"/> containing a <see cref="ResponseMessage"/>.</returns>
public abstract Task<ResponseMessage> ReplaceStoredProcedureStreamAsync(
Stream streamPayload,
string id,
Copy link
Member

Choose a reason for hiding this comment

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

Is id needed?

uriPathSegment: Paths.StoredProceduresPathSegment,
id: id);

return await this.ProcessStreamOperationAsync(
Copy link
Member

Choose a reason for hiding this comment

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

General pattern is Typed API's are layered over stream API.
And typed API wil do the extra ResponseFactory.CreateResponse part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Enables automation to merge PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scripts: Stream API for storedProcedure and trigger CRUD
2 participants