dhruvaagrawal
dhruvaagrawal
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
and would help reduce manual errors in case I forgot to include the updated_at field in any update query
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
yea, but if you're able to solve this, please do let me know. i wouldn't mind switching over the ORM-controlled version of maintaining updated timestamps as they'd be a better design choice.
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
hey, so I didn't actually solve the problem per se. i just started manually including the updated_at fields in every update query. i did this because i realised that for my system, the difference of milliseconds between the Date value generated by my codebase (which would happen if I did updated_at = new Date()) and the difference if the now() function was run by the database or even the ORM, was not important, and the presence of the data was more than enough.
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
oh alright. i'll give it a look. thank you tho!!
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
what do you think?
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
so my plan for now is to manually update the updated_at field everytime an UPDATE query is run, but would prefer if this was handled within the ORM
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
i was hoping this would be the case in drizzle as well, but having gone through the docs, seem to have found nothing for this.
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
i think this is how most ORMs do this internally. when running an update query, they ensure that a now() is called for the updated_at column because a user has given it a @updatedAt or @UpdationTimestamp annotation.
14 replies
DTDrizzle Team
Created by { ken } on 6/26/2023 in #help
Auto update for updated_at
hey @ken_peng did you get a solution for this? sorry i am new here, and am looking for this exact thing.
14 replies