zlacker

[parent] [thread] 3 comments
1. wodeno+(OP)[view] [source] 2021-06-12 10:19:09
> 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?

replies(3): >>xupybd+P >>maskli+11 >>chx+g1
2. xupybd+P[view] [source] 2021-06-12 10:28:26
>>wodeno+(OP)
Only in databases that have no Boolean type.

Sometimes it's an artifact of the orm mapping.

3. maskli+11[view] [source] 2021-06-12 10:30:44
>>wodeno+(OP)
So that you don't need a separate column for an associated datum?
4. chx+g1[view] [source] 2021-06-12 10:33:35
>>wodeno+(OP)
false 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.
[go to top]