#type orm current date + some extra time

1 messages · Page 1 of 1 (latest)

gentle gyro
#

i know of setting the default value to the current date, but what about adding X amount of time to it for example 10 minutes

verbal hornet
#

use a hook?

gentle gyro
# verbal hornet use a hook?

haven't seen those yet
in prisma i was just able to do this expire DateTime @default(dbgenerated("NOW() + interval '10 minute'"))
but dont think
@Column({ type: 'timestamp', default: () => 'NOW() + interval '10 minute'' })
is valid right?

#

or i could be dumb, and not realize i can set the default value to a function
because typeOrm is done in a TypeScript file, unlike prisma