hello guys, I am new to SupaBase and I have been f...
# off-topic
a
hello guys, I am new to SupaBase and I have been fiddling with it for about an hour. I plan to use it along with a nodejs project. Now I wish to find the max value in a column but I couldn't find details about it in the documentation, so how can I pull out the max value from a select statement?
or rather, can I run SQL commands from javascript?
What I actually wish to do is to insert a record with auto incremented ID and return the ID of this inserted record alone. My approach is to insert the record and retrieve the max of the ID column. Is there a better way to achieve this?
s
By default, the insert function will do just that: return the id(plus any other row columns): https://supabase.io/docs/reference/javascript/insert
a
Yes @User thanks for the help. My Issue is solved.