lexixon
lexixon
DTDrizzle Team
Created by lexixon on 1/14/2024 in #help
Common ways to reference and work with the `user_id` when managed by Supabase
Much appreciated, thanks! I got it to work.
16 replies
DTDrizzle Team
Created by lexixon on 1/14/2024 in #help
Common ways to reference and work with the `user_id` when managed by Supabase
I don't fully understand how I could keep it completely in sync given the auth.users table on Supabase side is not exposed and unless I want to build my own auth, I need another method to keep "main user data" in sync (as proposed by @francis ). Or do I miss something?
16 replies
DTDrizzle Team
Created by lexixon on 1/14/2024 in #help
Common ways to reference and work with the `user_id` when managed by Supabase
Thanks, that makes a lot of sense. I thought I may still just get the user information like name from auth.users directly but there's probably good reason to just duplicate/sync this information into a profiles table. If, let's say, you changed the user's email address, would you do this in the profiles table and build a mechanic to sync/write into auth.users automatically or is it easier if we stay one directional with such auth-related info and write to auth.users directly?
16 replies
DTDrizzle Team
Created by lexixon on 1/14/2024 in #help
Common ways to reference and work with the `user_id` when managed by Supabase
I guess we're meant to use a users_view here that we can make part of the public schema and then only work with users_view in drizzle-orm. Unfortunately we can't work with foreign keys then, like referencing a user_id in each entry in tools_to_qualities_to_users (or tools_to_qualities_to_users_view). So an alternative is to just use a proxy table users with one column uuid and keep that table in sync with auth.users via a trigger. Does that make sense or am I overcomplicating?
16 replies