News for hackers. Stuff that matters.
Re:Ask HN: Do You Use Enum for Yes, No, Unset? by marginalia_nu on Friday June 17, 2022 @05:13PM (#31784452)
I'd probably avoid using NULL in DB to convey a borderline-value for the simple reason that NULL has weird semantics in SQL and it can be pretty confusing.

If you're not using NULLs in DB, it's weird to translate an enum into a nullable Boolean.

In the end, there is very little downside to using enums in this case. It's by far the least confusing option.

There are no comments on this comment yet.