With one boolean, it is simply
1, and it's straight-forward to query.
With two booleans, it becomes necessary to specify what each number means, ex:
- 0 F-F
- 1 F-T
- 2 T-F
- 3 T-T
Here it's easy to query for all entries where the first boolean is T by
foo > 1. But what if it wants all rows where the second boolean is T (while still using the database index efficiently and without using OR)?
What if there are six booleans, and it wants to query for all entries where the first and third boolean are T, and the sixth boolean is F? Does there exist any design pattern to store booleans in an integer and allow this kind of querying?