-
Notifications
You must be signed in to change notification settings - Fork 76
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 glue code for query and queryRecord using pouchdb-find #130
implement glue code for query and queryRecord using pouchdb-find #130
Conversation
As suggested by @fsmanuel in pouchdb-community#128 and pouchdb-community#131.
fixing readme reference to config key, concerning adapter blueprint.
@BernardTolosajr and @nolanlawson, can I get an update on the status of this PR please. I'm doing a tidy-up pass through our PRs. |
Correct import of Ember Data model blueprint
I'm not really maintaining ember-pouch anymore because of a lack of time. As for pouchdb-find compatibility with relational-pouch/ember-pouch I'd say I'm very skeptical that it could work well although this PR looks to me like about the best possible way to do it. My only major feedback is that I had kind of hoped pouchdb-find functionality could be rolled into relational-pouch rather than ember-pouch, but as I said I basically have zero time for this project anymore, so my opinion probably matters very little at this point. 😅 |
Unit test courtesy of Matt Marcum @mattmarcum
[skip ci]
- Use Ember.get so that POJOs can be used instead of Ember.Object instances
…al-couch correctly
…lyfill for PhantomJS when running tests. - Add Ember.run() to taco-salad adapter to avoid exceptions when running tests
@BernardTolosajr I think that @nolanlawson raises a good point here. This functionality probably belongs in relational-pouch. Are you at all interested in adding it there? @nolanlawson are there many users of relational-pouch outside ember-pouch? @broerse what do you think about adding this functionality into ember-pouch? |
@aexmachina Sure, i will check on this. |
@BernardTolosajr @aexmachina I think because ember-pouch is the "interface" for ember-data this functionality needs to be in this module. If pouchdb-find is merged into relational-pouch or something ember-pouch still needs to facilitate this. So perhaps lets merge this. |
@aexmachina npm says 325 downloads in the past month for In any case, my goal with relational-pouch was to isolate the "pouch-y" stuff into that repo, and the "ember-y" stuff into this repo. In my mind, pouchdb-find falls squarely in the "pouch-y" part, hence my comment. OTOH maybe it makes sense to have ember-pouch just directly depend on relational-pouch and pouchdb-find. I'm fine with that too, if folks feel that it solves a real problem and isn't an unwieldy maintenance burden. |
…transform Attachments transform
@BernardTolosajr I like to merge this. Can you fix the conflicts? |
@broerse Sure, fixed conflicts. |
@BernardTolosajr 👍 I really like what you did but can we change |
@BernardTolosajr I also think changing |
return row.data; | ||
} | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will yield undefined elements in the array if there's no id. Is this what you want? Maybe you should use reduce?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad i did not anticipate missing id here, ill check on this using reduce.
@BernardTolosajr @aexmachina Good catch. Fix this in a new PR. Add test? |
@broerse 👍 ill submit a new PR. |
@aexmachina @broerse upon initial testing for missing id found out that pouchdb auto-generate the _id if its not provided. |
@aexmachina @BernardTolosajr Nice! I wil release 4.0.0 then. Thanks! |
@BernardTolosajr okay cool, but I still think that the mapper should be updated. Also, upgrading to v4.0.0 breaks the app because |
@aexmachina no it was some typo junk. v4.0.1 fixes this |
I'm running v4.0.1 and |
@aexmachina but you did not run |
@broerse okay, that is the right way to upgrade an ember addon isn't it :) |
Usage:
MyModel.query({selector: { name: "Mario" }, sort: ["name"]})
MyModel.query({selector: {debut: {$gte: 1990}})
MyModel.query({selector: { series: "Mario" }, sort: [{series: "desc"}, {debut: "desc"}]})
MyModel.queryRecord({selector: { name: "Mario" }})