-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support composite indices in schema literal types #3609
Conversation
Can you check why this breaks the CI? |
Thanks. CI didn't run when I opened the PR because I'm a first time contributor. I ran all the tests, but it looks like the error is in building. I've spent a little bit of time looking at it this morning and I'm not really sure how to resolve it at the moment. The core problem seems to be that Array.isArray has issues with ReadonlyArray. Various parts of RxDB use |
Are you shure that it is about EDIT: Ok I see that might have sth to do with the isArray calls that happen before. |
Yes we can use a custom typed isArray method that fixes microsoft/TypeScript#17002 |
Adjusting Please kick off CI when you get a chance. I was hoping since you had previously approved it it would just run, but the workflow apparently still needs approval. |
I approved the CI again. |
I fixed one of the two remaining failing jobs. I don't know how to run the "test:browser" one though. Running locally, the test never ends and just keeps printing:
I see the same thing running with the master branch. I'm guessing it's some environment thing, but I don't know where to even start looking into that. |
Master seems to be green again. Can you rebase? |
Will do. I figured out the messed up output was due Karma installing the trashed version of colors. There's a PR to lock that down in Karma. I'll drop the commit where I locked that down if it's no longer needed. |
@pubkey Rebased and pushed. I did not commit the dist/ files. I couldn't tell if that was something done manually or as part of a workflow. If it should be done manually, just let me know. |
Merged, thank you for your contribution. |
Thanks for being patient while that got sorted out. Hopefully future contributions go smoother. Do you think you'll cut a release soon-ish? I can set RxDB up as a git dependency, so not a big deal either way. |
I will do tomorrow |
This PR contains:
Describe the problem you have without this PR
Following "Option A" for typing for providing a schema and generating the doc type in TypeScript from the Use RxDB with Typescript guide, I tried to add a composite index to the hero example with something like:
As far as I can tell, that syntax should be okay. I consulted the RxSchema docs to be sure. However, making that change causes a TypeScript compilation failure when using the
RxJsonSchema
type. Using the "hero" example from the aforementioned TypeScript guide:I end up with the following compilation error:
Todos
Since it's a compilation error rather than a logical error, please advise on how you would like to see this tested.