[Vuejs]-Question about my vue test app with supabase

0πŸ‘

βœ…

If you are always expecting only one value then you should be using .single() along with that query. If however you are expecting zero to one row then you should use .maybeSingle(). If you don’t use either of these methods then you will always get the data returned as an array.

const { data } = await supabase.from("count").select("aantal").maybeSingle();

0πŸ‘

I used this it look better

 async function getCountries() {
    const { data } = await supabase
      .from("numbers")
      .select("aantal")
      .limit(1)
      .single();

    countries.value = data.aantal;
    console.log({ data });
  }

Leave a comment