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

Implement queries #7 #74

Closed
wants to merge 4 commits into from

Conversation

leojpod
Copy link

@leojpod leojpod commented Jun 28, 2015

This is a temporary implementation to support the queries in ember-pouch

@leojpod
Copy link
Author

leojpod commented Jun 28, 2015

@nolanlawson This works but I do not like it. I wish to work with pouchdb-find but I've some issue with that. I guess pouchdb-find should be integrated with relational-pouch but I did not find the right way to do it.

@broerse
Copy link
Collaborator

broerse commented Jun 29, 2015

@leojpod Interesting. Is it not better in this case to use https://github.com/brianreavis/sifter.js/ than write your own?

@leojpod
Copy link
Author

leojpod commented Jun 29, 2015

@broerse not sure if it is worse the trouble for his case: it is a temporary solution, using pouchdb-find would make more sense and would give better performance I guess and I am not sure which other query option should be added.

Do you think we should add support for more than regex and straight equal ?

@broerse
Copy link
Collaborator

broerse commented Jun 29, 2015

Regex and straight equal is fine. I only tend to us sifter.js when I need filtering and was wondering if I would use this. Thanks for this PR.

@nolanlawson
Copy link
Member

I do think that the first step ought to be to integrate pouchdb-find into relational-pouch. Sorry for the radio silence, but I've been on vacation for the past few weeks. :)

This next weekend I'll try to do a big push to get pouchdb-find closer to production status, and to get it integrated into relational-pouch. I know it's been a big ask from the community, so it's number one on my priority list.

@nolanlawson
Copy link
Member

Related to pouchdb-community/relational-pouch#3

@patuku-roy
Copy link

@nolanlawson just asking about what you are going to work on it , is it related to hasMany issue ? because I believe this is something need to solve soon because those issues has very close relation. Btw, nice work ... thanks a lot

@broerse
Copy link
Collaborator

broerse commented Jul 19, 2015

@patuku-roy The hasMany issue should be fixed with serialize:true takes priority over the OneToMany check for relationships. See emberjs/data#3214. I started testing but I did not have more time to check it out. Please report back if it works.

@fsmanuel
Copy link
Collaborator

I'm not sure when ember-data added _shouldSerializeHasMany but in 1.13.x it is available
We can add that line to the serializer and add a section to the readme that ppl should import the serializer.

  _shouldSerializeHasMany: function() { return true; }

@patuku-roy
Copy link

@broerse I don't have a chance yet to try that way, I will post the feedback if I have a chance, meanwhile I'm working on other stuff, while waiting the query stuff in here.

@fsmanuel unfortunately I'm stuck with ED Beta-18 right now, the project has been too complicated to port to latest ED, do you have a chance looking at ED Beta-18 yet?

@nolanlawson OOT, since the npm maintainer has been changed, are you still working on this? I really keen to hear the update about the query feature, this is a simple thing but very crucial on my project :) ... I've been tried integrate the pouchdb-find to ember-pouch but I guess I did the wrong direction because pouchdb-find suppose to be integrate inside relational-pouch rather than directly inside ember-pouch. So any updates about this, will be really helpful ... and really thanks for your great work 👍 👍 👍

@nolanlawson
Copy link
Member

Yes, I have a bunch of changes in store for pouchdb-find that I hope to integrate into relational-pouch (one PouchDB plugin can depend on another; it's easy). pouchdb-find improvements will be part of my project for the summer. :)

@patuku-roy
Copy link

@nolanlawson Cool, can't wait ... Thanks in advance for your work :) ... 👍 👍 👍

@nolanlawson
Copy link
Member

Sorry, my bad for leaving this PR hanging for so long. The tests look fantastic, and I would love to see this re-worked into a new PR, but I do think the right approach is to use pouchdb-find, which maybe should be integrated into relational-pouch first. (Or maybe not! the relational-pouch API does expose ways to translate between the relation-y IDs and the normal PouchDB _ids, so it's possible that you could integrate both into ember-pouch without changing relational-pouch at all.)

In any case, I'm gonna close for now, please rebase and reopen if you have a chance to work on it.

@leojpod
Copy link
Author

leojpod commented Aug 26, 2015

@nolanlawson No problem, this was just a temp fix :) I agree that it should be done in another way.

I had looked at the relational-pouch code but I wasn't really sure of where to plug the pouchdb-find. I will look at it again another day (if no one does it before!)

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.

5 participants