chatGPT just once again blew my mind it got the first try wrong using the nodejs 'pg' package (pic 1) The tableExists const is never null so the check obviously would be true all the time (pic 2) So i asked it to fix it (pic 3) And it fixed it. I couldnt google this answer!