2 ms·
For nullable timestamps, the timestamp itself is opaque. Having a value is indication that the thing happened. The time reading is orthogonal to that question.
by echelon 4y ago
For nullable timestamps, the timestamp itself is opaque. Having a value is indication that the thing happened. The time reading is orthogonal to that question.
If your language has a tough or flexible time with falsy, I found your problem. You shouldn't even be in that headspace, and languages that put you there introduce so much mental overhead that they're not worth it.
You shouldn't need to do research here. This should be a one and done solution from your toolbox that you can pull out at a moment's notice: "How do I handle record soft deletion and store some state around when it happened?" - zero effort, tried and true recipe borne of experience.
The database and data stores drive your product. They're the heart and soul.
- crazygringo 4y agoSo the problem is with SQL, because NULL doesn't act the same as false, and boolean operators may give incorrect results if you expect them to? I'm not sure how to respond if you think people shouldn't be in the headspace of SQL.
- echelon 4y agoIn SQL you won't typically coerce null to false, though there are mechanisms to accomplish this (which can be useful for analytics, ETLs, etc). Presence is first class and is probably what you want in your business logic queries. If you let the SQL query predicates handle which records to select, I'm not sure I see the problem you originally outlined. Why do you care what value the timestamp has when the question is whether or not a record experienced an event.