tigrisdata-archive / tigris-client-ts

TypeScript client for Tigris
https://www.tigrisdata.com/docs/sdkstools/typescript/
Apache License 2.0
15 stars 10 forks source link

refactor: primaryKeyOptions as optional if there is only one primary key for collection #308

Closed akhill10 closed 1 year ago

akhill10 commented 1 year ago

Describe your changes

242

/claim #242

How best to test these changes

Issue ticket number and link

Fixes: #242

adilansari commented 1 year ago

Minor comments, otherwise looks good overall. I'll approve it.

adilansari commented 1 year ago

This fixes the schemas generated using classes and decorators. We have an alternate way to define schema using interfaces, that some users prefer (docs link).

It would be great to make this order optional there as well.

That schema defined as an interface gets converted to raw JSON as follows: https://github.com/tigrisdata/tigris-client-ts/blob/dc1c69d43bfac870e3d0c1754abccfd6bcad4bc0/src/db.ts#L159

If multiple primary keys are defined without order, we can raise similar error here: https://github.com/tigrisdata/tigris-client-ts/blob/dc1c69d43bfac870e3d0c1754abccfd6bcad4bc0/src/utility.ts#L312-L322

Feel free to find me on discord as adil if you need more help.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.0.0-beta.45 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: