On 10/19/07, Dan Pascu <[EMAIL PROTECTED]> wrote:
>
> Which I believe pretty much explains that it doesn't really matter if it
> is tinyint(1) or tinyint(4) (the default), as I explained in the previous
> email.

Ah, your explanation makes it very clear, thank you.

In this case I think it would be better to use BOOL (or if MySQL 4.1
can be assumed BOOLEAN) for BoolCol in the MySQL backend.


On 10/19/07, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
>
>    Hence I'd like to give a type for the column as "*INT*" - INT or
> INTEGER, but not BOOL. Yes, it could be BOOL, but what is the point of
> using so-called "standard SQL" (what DBMS really implements it instead of
> implementing an extended subset?) in such non-standard DBMS as SQLite? The
> only reason I can think of is to help fromDatabase machinery to guess the
> type of the column.

OK, thank you for explaining SQLites behavior to me.  I understand it
better now.  After reading http://sqlite.org/datatype3.html again, I
still think that BOOLEAN should be used for the SQLite backend:

*) It has the advantage you already pointed out in helping fromDatabase.

*) According to point 2.3 subpoint 5. at
http://sqlite.org/datatype3.html, the affinity when specifying BOOLEAN
(or FOO or BAR) is NUMERIC.  And a bit above the docu says

"""A column with NUMERIC affinity may contain values using all five
storage classes. When text data is inserted into a NUMERIC column, an
attempt is made to convert it to an integer or real number before it
is stored. If the conversion is successful, then the value is stored
using the INTEGER or REAL storage class. If the conversion cannot be
performed the value is stored using the TEXT storage class. No attempt
is made to convert NULL or blob values.

A column that uses INTEGER affinity behaves in the same way as a
column with NUMERIC affinity, except that if a real value with no
floating point component (or text value that converts to such) is
inserted it is converted to an integer and stored using the INTEGER
storage class."""

So the BoolCol value would end up being stored in the INTEGER storage
class.  IMO using INTEGER affinity has in this case no advantage over
using NUMERIC affinity, which can be achieved by using BOOLEAN in the
column definition.

Kind regards,
Markus

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to