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

[DEVEX-106] Fix proposal #372

Merged

Conversation

balanza
Copy link
Contributor

@balanza balanza commented Mar 28, 2024

I propose a fix on #371

The DocumentSearchKey type ensures we query database object by fields whose type is string (for model id) or string | number (for partition key)

@balanza balanza requested a review from a team as a code owner March 28, 2024 14:21
@balanza balanza requested review from michaeldisaro, pasqualedevita and lucacavallaro and removed request for a team, michaeldisaro and pasqualedevita March 28, 2024 14:21
Copy link

Jira Pull Request Link

This Pull Request refers to the following Jira issue DEVEX-106

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Record<PartitionKey, string | number>
? PartitionKey extends ModelIdKey // partition key === model id means no partition key is provided
? readonly [string]
: readonly [string, string | number]
Copy link
Member

@lucacavallaro lucacavallaro Mar 28, 2024

Choose a reason for hiding this comment

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

maybe we should also support boolean (?)

Suggested change
: readonly [string, string | number]
: readonly [string, string | number | boolean]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically yes. What boolean partition key you imagine to use?

Copy link
Member

Choose a reason for hiding this comment

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

I can't imagine any! I was just wondering to "adhere" to the PrimaryKey type of @azure/cosmos which puts it among the supported scalars

@balanza balanza merged commit 8d1fb6f into DEVEX-106-update-cosmos-sdk Mar 28, 2024
3 checks passed
@balanza balanza deleted the DEVEX-106-update-cosmos-sdk-variant branch March 28, 2024 21:08
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.

2 participants