-
Notifications
You must be signed in to change notification settings - Fork 241
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
Added caching in relationships (+ test cases) (enhanced) #141
Conversation
note: there seems to have a problem with sqlite which go back more than 20 days ago. All values sent to database seems to be replaced with "?". I just learned it via travis. |
@@ -702,6 +709,23 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) { | |||
* | |||
* @param {Class} anotherClass - class to belong | |||
* @param {Object} params - configuration {as: 'propertyName', foreignKey: 'keyName'} | |||
* | |||
* {Usage examples} |
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.
In markdown source code examples indented with four spaces. Plus one space after *, so it should be indented with five. All other is fine. Thanks. And sorry for pain :) If you want to check how your documentation looks like, goto: http://jsdoc.info/sdrdis/jugglingdb/abstract-class.html#class/belongsTo
This is for escaping. Following api: query('select ? from ? where a = ?', On Sat, Nov 3, 2012 at 4:48 AM, Sébastien Drouyer
Thanks, |
Noted for the spaces ;) But for sqlite there seems to be a problem though : Here is what I got from travis (https://travis-ci.org/#!/1602/jugglingdb/jobs/3041384): INSERT INTO |
There's no problem is all tests passed for sqlite adapter. If you look to On Sat, Nov 3, 2012 at 4:53 AM, Sébastien Drouyer
Thanks, |
Sorry I was just surprised by the sql debug logs :). I fixed the indentation issues as adapted to the markdown syntax. |
Added caching in relationships (+ test cases) (enhanced)
Some tests broken. Please run
|
I ran the tests at home before pushing with mysql, sqlite3, and postgresql, and it works for me everywhere even on sqlite3 (where as on travis it bugs). I will take a look tomorrow at my packages versions to see if there are differences. Thanks and sorry :). |
I fixed my sentences + added usage examples in the comments.
Previous message :
Don't hesitate to comment since I might have done some mistakes :).
For the belongsTo relationship ;
I added a optional parameter refresh which allows to force refresh
If the relation was loaded before and refresh is false or not set, then relation is loaded from cache
For the hasMany relationship ;
the first parameters can be either condition or refresh
if the relation was loaded before AND refresh is false or not set AND condition is not set, then relation is loaded from cache