Hello,
I've got some sqlite databases with boolean columns that use 1 and 0
as true and false. Sequel can read this just fine. When I write to a
database with something like DB[:some_table].update(:some_column =>
boolean) Sequel will write the boolean as 't' or 'f', which I don't
want. Of course I could explicitly write 1 or 0, but it would be nice
if I did not have to. So this is what I wrote, to be required after
requiring sequel:
module Sequel
module SQLite
module DatasetMethods
BOOL_TRUE = '1'.freeze
BOOL_FALSE = '0'.freeze
end
class Dataset < Sequel::Dataset
def literal_true
BOOL_TRUE
end
def literal_false
BOOL_FALSE
end
end
end
end
It seems to work so far in a few minutes worth of testing. Is there a
better way to do this?
--
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.