can't save booleans to a posgresql database

Seb Ruiz ruiz at kde.org
Thu Nov 8 07:10:14 UTC 2007


On 08/11/2007, Daniel Holth <dholth at fastmail.fm> wrote:
> Seb Ruiz wrote:
> > On 08/11/2007, Daniel Holth <dholth at fastmail.fm> wrote:
> >
> >> More postgresql problems.
> >>
> >> The hacked Amarok recognizes the 't' from postgresql just fine now that
> >> my boolT() returns t instead of true for postgresql. Unfortunately,
> >> postgresql does not accept an unquoted t. So hilariously the hacked
> >> amarok can load booleans just fine, but cannot save them any more (TRUE
> >> and FALSE are keywords and so were saved without quoting).
> >>
> >
> > This is bad, because it would next to impossible to fix this without
> > further regressions if we can't be certain that sqlite and mysql
> > accept boolean values wrapped in quotes.
> >
> It will simply be necessary to have to have one 'isTrue()' method for
> values coming out (apologies for the Java-ism), and a different boolT()
> method for values going in. I know the MySQL JDBC driver just goes ahead
> and checks for t, true, y, yes, 1 and will accept any of those as 'true'
> when reading from the database. (Of course, MySQL doesn't really have a
> boolean type).
>

Yes, I have done this just now. Compiling and testing.


-- 
Seb Ruiz

http://www.sebruiz.net/



More information about the Amarok mailing list