why is `id` not considered a property? #131

Closed
pyramation opened this Issue Oct 11, 2012 · 2 comments

Projects

None yet

2 participants

I am having issues when trying to do where queries that use id, since it is not considered a part of the properties.

    var opts = {
        where: {id: id, deleted: false}
    };

    Model.findOne(opts, callback);

I'm all for defining id in the properties when using jugglingdb, but since it is implicitly defined, I think it should also be something that can be used in queries.

I was able to get this to work by manually adding id before a where query is built, although this should probably be somewhere in the abstract-class. but here is my short term solution from buildWhere in the mysql adapter:

props.id = {type: Number};
Collaborator

Hey Dan,

I've done with some work on refactoring and optimization in jugglingdb
core. I see 5x performance improvement on reading from database. Your case
also fixed. Now id is part of properties definition. Let me know if your
issues resolved.

Thanks,
Anatoliy

On Thu, Oct 11, 2012 at 10:54 PM, Dan Lynch notifications@github.comwrote:

I am having issues when trying to do where queries that use id, since it
is not considered a part of the properties.

var opts = {
    where: {id: id, deleted: false}
};

Model.findOne(opts, callback);

I'm all for defining id in the properties when using jugglingdb, but
since it is implicitly defined, I think it should also be something that
can be used in queries.

I was able to get this to work by manually adding id before a where query
is built, although this should probably be somewhere in the abstract-class.
but here is my short term solution from buildWhere in the mysql adapter:

props.id = {type: Number};


Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/issues/131.

everything works great! I just merged the upstream and things are blazing fast!!

thank you Anatoliy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment