tags:

views:

2157

answers:

2

Hi,

What is the type for a BOOL value in SQLite? I want to store in my table TRUE/FALSE values.

I could create a column of INTEGER and store in it values 0 or 1, but it won't be the best way to implement BOOL type.

Is there a way?

Thanks.

+3  A: 

There is no native boolean data type for SQLite ref: documentation.

Lasse V. Karlsen
"INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value." I guess using 1 byte to store a BOOL isn't too bad.
Joce
As good as it gets I would suppose.
Lasse V. Karlsen
A: 

The best data type you can use is called "Blob" since it will store whatever you want. It can be boolean, it can be an array, or it can your own custom data type.