Added support for throughput buckets. #2713
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to support "throughput buckets" in the CosmosDB query editor. The changes include updates across multiple files to enable users to select a throughput bucket when running queries, as well as backend logic to manage and update the state of throughput buckets.
Note: ATM the buckets don't get verified. The API doesn't contain a way to get the information. The portal seems to include calls/functions to retrieve the information but the SDK seems not do to that. I didn't want to duplicate portal code in the extension.
Backend updates for throughput buckets:
src/cosmosdb/session/QuerySession.ts
: Added support for passing the selected throughput bucket to the connection policy when initializing the query session.src/cosmosdb/types/queryResult.ts
: Extended theResultViewMetadata
type to include athroughputBucket
property.Frontend updates for throughput bucket selection:
src/panels/QueryEditorTab.ts
: Added a methodupdateThroughputBuckets
to fetch and update the throughput bucket options, with placeholder logic for now.src/webviews/cosmosdb/QueryEditor/QueryPanel/RunQueryButton.tsx
: Updated the query execution logic to include the selected throughput bucket and added UI elements (checkboxes and menu items) for selecting throughput buckets in the query editor. [1] [2]State management for throughput buckets:
src/webviews/cosmosdb/QueryEditor/state/QueryEditorContextProvider.tsx
: Added event listeners and methods to update the throughput bucket state and handle bucket selection. [1] [2]src/webviews/cosmosdb/QueryEditor/state/QueryEditorState.tsx
: Extended the state to includethroughputBuckets
andselectedThroughputBucket
, and added actions for selecting and updating throughput buckets. [1] [2] [3] [4]