BOOL is an alias for TINYINT(1), which accepts 5
and -1 as happily as 1, and gives them back unchanged. vsql_boolean adds
a STRICTBOOL column type that stores one byte and holds two values.
Install
vsql_boolean.veb is already in the server’s lib/veb/ directory if you
installed VillageSQL with the install script, the Docker image, or a release
tarball. Install it into the server with one statement:
What it adds
The STRICTBOOL type
ASTRICTBOOL column takes the strings 'true'/'false', 't'/'f',
'yes'/'no', 'on'/'off' and '1'/'0', in any letter case. Pass them as
strings: a bare number is refused. It reads back as true or false whichever
form went in, and it occupies one byte.
Functions
Example
Anything outside the accepted spellings is refused at insert time:
INSERT INTO flags VALUES (5, 'eps', 'maybe') fails with
ERROR 1366 (HY000): Incorrect STRICTBOOL value: 'maybe' for column 'active' at row 1. So does an unquoted 1, with
ERROR 3219 (HY000): Incorrect STRICTBOOL value: '1' for column 'active' at row 1.See also
- Choosing data types — when a narrower type earns its place
- Install extensions — how
INSTALL EXTENSIONworks and where the server looks for a bundle - Available extensions — the full catalog
- villagesql/vsql-boolean — source, build instructions, and the known limitations

