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

SQLite fails when trying to find with a boolean field #292

Closed
colegleason opened this issue Aug 8, 2013 · 3 comments
Closed

SQLite fails when trying to find with a boolean field #292

colegleason opened this issue Aug 8, 2013 · 3 comments

Comments

@colegleason
Copy link

I have a model with a boolean field running on an SQLite3 database.

If I try to use find like this:

db.models.endpoint.find({active: true}, function(err, endpoints) {                                                                                                            
    if (err) {                                                                                                                                                                
        console.log(err);                                                                                                                                                     
        done.abort();                                                                                                                                                         
    }                                                                                                                                                                         
    console.log(endpoints);                                                                                                                                                   
    done(endpoints);                                                                                                                                                          
});      

I get the error:

{ [Error: SQLITE_ERROR: no such column: true] errno: 1, code: 'SQLITE_ERROR' }

However, if I call find with an integer instead

db.models.endpoint.find({active: 1}, function(err, endpoints) {                                                                                                            
    if (err) {                                                                                                                                                                
        console.log(err);                                                                                                                                                     
        done.abort();                                                                                                                                                         
    }                                                                                                                                                                         
    console.log(endpoints);                                                                                                                                                   
    done(endpoints);                                                                                                                                                          
});

I get the results that I am expecting.

Node 0.10.9
sqlite3 2.1.14
orm 2.1.0

@dresende
Copy link
Owner

Try with sqlite3 2.1.7. We have issues from that version forward that are not resolved yet.

dresende added a commit that referenced this issue Aug 20, 2013
SQLite fails when trying to find with a boolean field
@dresende
Copy link
Owner

Please try the latest commit, don't forget to update dependencies.

@dresende
Copy link
Owner

This should be fixed, reopen otherwise.

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

No branches or pull requests

2 participants