Update date field with supabase's instance date
Hey! does it possible to update date field in table to be like
NOW()?
example:
is this valid? can't find any mention in the docs.3 Replies
You can use these keywords:
https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE
PostgreSQL Documentation
8.5. Date/Time Types
8.5. Date/Time Types # 8.5.1. Date/Time Input 8.5.2. Date/Time Output 8.5.3. Time Zones 8.5.4. Interval Input 8.5.5. Interval Output PostgreSQL supports …
Nice!
so it seems like
now() is does supported by this update with supabase clientYes you can use those as the column value (string) from the rest api.
So you would use 'now' for the column value event though a timestamp.
I prefer to use a Postgres trigger function on before update to set it to now() though. Then the user can't change it.