4 ms·
I don't think it's elegant at all. Especially in SQL dialects where you need to check null state separately from false. So much bug potential...
by m_mueller 5y ago
I don't think it's elegant at all. Especially in SQL dialects where you need to check null state separately from false. So much bug potential...
- Spivak 5y agoWith an enum you’d have to check the unset state separate as well.
- crocarneiro 5y agoHe meant that in some SQL Dialects you cannot check FIELD = NULL, you have to use FIELD IS (NOT) NULL (like Oracle). Therefore you cannot use FIELD inside an IN clause either.
- andix 5y agoBut with an (NOT NULL) enum/integer/string or however you are representing it, every state is a regular case. Not a special case. Null nearly always needs some special treatment.