简体   繁体   English

超级基地。 在另一个表中注册时如何插入用户信息?

[英]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.在我的站点(Supabase + Vue.js)上注册新客户端时,如何在 %BASE_NAME% 数据库中创建一个包含以下字段的条目:注册客户端的 uuid 和一个带有空对象的 JSON 字段。 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.您不能直接查询 auth 表,因此您需要创建一个为您工作的函数,当对 auth.users 进行新条目时触发。

Some details here:这里有一些细节:
https://nikofischer.com/supabase-how-to-query-users-table 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以及描述该过程的视频: https ://egghead.io/lessons/supabase-use-supabase-to-subscribe-to-database-events-with-postgres-triggers

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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