4 ms·
> SELECT item_id WHERE expire = 0 I come across a lot of SQL databases that uses 0 instead of false. Is there any good reason for this?
by wodenokoto 5y ago
> SELECT item_id WHERE expire = 0
I come across a lot of SQL databases that uses 0 instead of false.
Is there any good reason for this?
- xupybd 5y agoOnly in databases that have no Boolean type. Sometimes it's an artifact of the orm mapping.
- masklinn 5y agoSo that you don't need a separate column for an associated datum?
- chx 5y agofalse would be "expired", this is called "expire" because it is a timestamp, it's the epoch time when the item expires. The worker presumably finishes before that time and if it does then the item is deleted. So, if any item has a nonzero expires in the past then it needs to be reset to 0 so it can be retried.