On 5 Dec 2016, at 11:18am, Frank Millman <fr...@chagford.com> wrote:

> So if I understand correctly, it makes sense to use ‘1’/’0’ to *set* the 
> boolean value in a cross-database manner, but there are a variety of ways to 
> test for it.

Rather than the strings it would be better to use the integers 0 and 1.  This 
is how SQLite handles boolean values internally.  And they take less storage 
space and are faster to handle.

Although other values (e.g. 1.0 or the strings '1' or '1.0') may evaluate to 0 
or 1 under some circumstances, this relies on context, affinities, and other 
accidents of syntax.  But the integers always test as FALSE and TRUE.  And 
defining a column with a type of INTEGER is as close to BOOL as SQLite gets.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to