© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago•
6 replies
Solemensis

Insert Row is not working with click event

I can insert rows with this code, it works;

 const { data, error } = await supabase
  .from('myrow')
  .insert([
    { id: 11, desc: 'heyrow' },
  ])
 const { data, error } = await supabase
  .from('myrow')
  .insert([
    { id: 11, desc: 'heyrow' },
  ])


But it inserts only on page re-loads of course. When i try to wrap it in a async function;


async function insert() {
 const { data, error } = await supabase
   .from('myrow')
  .insert([
    { id: 11, desc: 'heyrow' },
  ])
}
async function insert() {
 const { data, error } = await supabase
   .from('myrow')
  .insert([
    { id: 11, desc: 'heyrow' },
  ])
}


and put it on a click event; (vue/nuxt3)
<button @click="insert()">click</button>
<button @click="insert()">click</button>


Row insert is not working with click event. What am i doing wrong?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

insert row from flutterflow isnt working
SupabaseSSupabase / help-and-questions
13mo ago
Upsert not working with Row Level Security
SupabaseSSupabase / help-and-questions
3y ago
Insert pgp_sym_encrypt() not working
SupabaseSSupabase / help-and-questions
3y ago
Create new table on row insert
SupabaseSSupabase / help-and-questions
4y ago