Check if something exists in table, If not make it

Im wanting check if a discord users ID is in my table by using (code below).
const { data, error } = await supabase
      .from('test')
      .select()
      .eq('uuid', interactionAuthorID.toString());

But when there is nothing found data is set to [] and error is
null
, am I supposed to be doing this another way? I was thinking if I got an error of something along the lines of 'data does not exist in the table' then I could then create the data.
Was this page helpful?