Skip to content

Conversation

@mlecoq
Copy link
Contributor

@mlecoq mlecoq commented May 17, 2022

Currently if we make a query with joined tables, we cannot sort on columns of joined tables.

The goal of this PR is to be able to indicate on which table sort is applied

@radex
Copy link
Collaborator

radex commented May 23, 2022

Looks nice, but please either add relevant support to adapter/lokijs too, or at least, add a check that will throw an Error when attempting to construct a loki query with this feature with a useful error message

@radex
Copy link
Collaborator

radex commented May 23, 2022

please also add a test here: https://github.com/Nozbe/WatermelonDB/blob/master/src/__tests__/databaseTests.js#L860 that actually checks for correct behavior (not just expected query syntax). this is important for checking cross-adapter compatibility

@mlecoq
Copy link
Contributor Author

mlecoq commented May 24, 2022

Thanks for your feedback

@mlecoq
Copy link
Contributor Author

mlecoq commented May 24, 2022

Looks nice, but please either add relevant support to adapter/lokijs too, or at least, add a check that will throw an Error when attempting to construct a loki query with this feature with a useful error message

I have chosen to throw an error, sorting on joined tables doesn't look to be supported currently on loki.js

@KrisLau

This comment was marked as off-topic.

@mlecoq mlecoq force-pushed the feat/sortOnJoinedTable branch 5 times, most recently from ace528b to b90a8ca Compare June 17, 2022 13:09
feat: update ts definition for sortBy method

fix: throw error when sort by is used on joined table with loki

test: add integration test on sort on joined table
@mlecoq mlecoq force-pushed the feat/sortOnJoinedTable branch from b90a8ca to 42dcad1 Compare May 2, 2023 12:13
@sumansaurabh00001
Copy link

Is this still active? I am waiting for this.

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.

4 participants