简体   繁体   中英

Supabase. How to insert user information when registering in another table?

When registering a new client on my site (Supabase + Vue.js), how do I create an entry in the %BASE_NAME% database with the following fields: uuid of the client who registered, and a JSON field with an empty object. Somewhere in the documentation I saw, it seems, similar examples, but I can't find them now. Thank you!

This looks like a job for a trigger and a function.

You can't query the auth table directly, so you need to do create a function that does this work for you, triggered when a new entry is made to auth.users.

Some details here:
https://nikofischer.com/supabase-how-to-query-users-table

And a video describing the process here: https://egghead.io/lessons/supabase-use-supabase-to-subscribe-to-database-events-with-postgres-triggers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM