Hi guys! Good day to you all. Does D1 really consider 0 as NULL? I have a NOT NULL constraint on m

Hi guys! Good day to you all. Does D1 really consider 0 as NULL?


I have a NOT NULL constraint on my table.. when saving 0, it returns a
Error: D1_ERROR: FOREIGN KEY constraint failed
      at D1Database._sendOrThrow (cloudflare-internal:d1-api:66:19)

I have already logged the input, and confirmed, it is indeed 0 and typeof number.. and is absolutely NOT null... but it still results to an error..


If ever, what would be the workaround for this? I definitely would wanna save 0 but do not want a null
Was this page helpful?