Is it possible to define bit column in sqlite? [duplicate]
Asked Answered
K

2

9

Sounds like a basic question but I couldn't seem to find it. Is there a way to define in SQLite a column which will be a single bit?

Kalbli answered 3/12, 2013 at 12:34 Comment(0)
J
16

No.

SQLite does not have a separate Boolean storage class. Instead, Boolean values are stored as integers 0 (false) and 1 (true).

Source

Jamison answered 3/12, 2013 at 12:35 Comment(2)
I guess it is because, internally sqlite takes only required amount of memory and it is optimized in that way, So, an Integer field holding value 0 or 1 will only take 1 byte.Eastwards
They could save space by joining the result of 8 rows boolean values and saving them as a byte... but looks like nobody caredIndivertible
E
-1

AS at 2021-01-20, I should say YES, you can define bit datatype in SQLite and it's working.

Extensile answered 20/1, 2021 at 4:21 Comment(1)
Your answer is incorrect, sqlite contains boolean, but boolean is not true/false, it is any boolean number. OP is asking for a single bit.Infamy

© 2022 - 2024 — McMap. All rights reserved.