Auto increment ID in JavaScript
Is there a way to get the last greatest ID in a table and then increment off of that for the next row of data?
{ascending: false} means descending. @Mod{"code":"22P02","details":null,"hint":null,"message":"invalid input syntax for type bigint: \"[object Object]1\""}
given thatmeans descending.{ascending: false}
Is Identity box checkedmessage attribute and it started the count as 10
SELECT * FROM Table ORDER BY ID DESC LIMIT 1await supabase.from('table').select('id').order('id', {ascending: false}).limit(1)const lastID = await supabase
.from('test')
.select('id')
.order('id', { ascending: false })
.limit(1);
const { error } = await supabase
.from('test')
.insert({ id: lastID + 1, message: 'test' });
console.log(JSON.stringify(error));