SQLite boolean values in Lua
SQLite does not have a separate Boolean storage class. So, when Lua reads the column from the database, it cannot determine that the value is intended to be a Boolean rather than a number.
BTW, when lsqlite3
stores a Lua Boolean using one of the bind
methods, it does note that Lua intends to store a Boolean, and converts the value to integers 0 (false
) and 1 (true
).
Since you are programming in Lua, you'll have to accept the fact that Lua treats numbers as numbers, not as Booleans. My recommendation is that you convert the numbers to Booleans in Lua right after you read them from the database.