Re: Re: [CLSQL-Help] inserting FALSE
Kevin Rosenberg <kevin-HJRc7zDS/[email protected]> Thu, 11 May 2006 14:45:50 -0600
| Newsgroups | gmane.lisp.clsql.devel |
|---|---|
| Message-ID | <[email protected]> |
bsd1628 wrote:
> If I understand him correctly, perhaps a way to deal with boolean values
> would be to treat them identically across backends, that is, use some
> kind of base integer or character field to store the value NOT NULL.
> Then when processing a value translate (t nil) <--> ('t', 'f'), nulls
> not allowed.
I think that's quite reasonable. But, it does prevent folks from using
simple boolean in WHERE clauses. I'm not sure if that is ansi
compliant or not. MySQL, for example, recently got the ability to
say "SELECT * FROM foo WHERE bar". Instead, something like
"SELECT * from foo where bar='t'" would be needed.
Further, there is an issue of backward compatibility. MySQL, for
example, has a BOOLEAN type that is a synonym for TINYINT. Changing
CLSQL to consider a boolean as CHAR(1) would prevent CLSQL from being
used with tables created with MySQL's native boolean type.
I'm not sure there is a perfect answer given there is a trade-off
between idiosyncratic sql engine abilities vs. a more cumbersome, but
consistant across sql engines, solution.
Kevin