You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have this piece of code and for some reason it wont replace the $2 with the proper variable
code is varchar(10)
expiryDate is date
let imageID = 'ABCDEFG'
let lifetime = 604800000
await this.pg.query("INSERT INTO media(code, expiryDate) VALUES($1, CURRENT_DATE + INTERVAL '$2 ms')", [imageID, lifetime])
it says it requires only one parameter but I have two in there.
I have to make my query like this
await this.pg.query(INSERT INTO media(code, expiryDate) VALUES($1, CURRENT_DATE + INTERVAL '${lifetime} ms'), [imageID])