On Jul 16, 1:12 pm, Brad <[EMAIL PROTECTED]> wrote:
> Hello,
>
> The recent change to Sequel to treat tinyint mysql columns as boolean
> values has caused a few problems for some of my projects. I
> understand that column-value converting can be disabled, but since it
> is the default behavior I think further discussion might be warranted.
>
> I think treating a column that can store valid integers as a boolean
> is dangerous and can lead to data loss. I would love to see the
> feature reverted or implemented using enum('t','f') or some other
> mysql-supported concept. If that is not possible, perhaps when any
> number other than 0 or 1 is assigned to a tinyint column sequel can
> raise an error. Right now, if I create a row with a tinyint value of
> 5, it gets silently converted to 1 by Sequel. Raising an error would
> protect developers who attempt to store numbers in their tinyint
> columns.
I think if MySQL had a real boolean type, convert_tinyint_to_bool
wouldn't exist. It only exists because MySQL doesn't have a real
boolean type.
I don't understand the problem. If you want to treat it as an
integer, use Sequel.convert_tinyint_to_bool = false. If it is
converting tinyint to boolean with that set to false, there is a bug.
> From my perspective, the tinyint/boolean design choice does not go
> well with the rest of sequel's behavior and I would love to see it
> changed or removed.
The option for treating it as an integer is already there. I think
treating tinyint as boolean is the best default, until MySQL supports
a real boolean datatype.
FWIW, I would love not to have to support MySQL at all.
Jeremy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---