It turns out that with 1/0s as booleans, Sequel's default behavior
only works sometimes:

DB[:some_table].where(:some_column) or
DB[:some_table].where(~:some_column) works
DB[:some_table].where(:some_column => boolean) does not work

On Feb 10, 2:20 pm, Jeremy Evans <[email protected]> wrote:
> That's probably the best way.  The reason Sequel doesn't operate that
> way by default, besides historical behavior, is the SQLite adapter
> does not do type translation on values SQLite stores as integers.  If
> you have a boolean column and you put in an integer value, SQLite
> stores it as an integer, so upon retrieval, you would get a 1 or 0
> instead of true or false.

It might be worth documenting this somewhere, as SQLite's
documentation tells users to store booleans as 1 and 0:
http://sqlite.org/datatype3.html

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to