Supabase postgres() & createClient() connection both in the same node server
Hello,
Question: Is this a good thing to do? Which of the one method is recommended if this is a bad idea. Please let me know.
Overview :
I have create the below file
Now I can use both functionalities anywhere in my app. Incase I want to raw dog SQL, I can just use sql
I did this because i wasn't able to use complex joins using the api connect. So i can use any one of them when needed.
Question: Is this a good thing to do? Which of the one method is recommended if this is a bad idea. Please let me know.
Overview :
I have create the below file
db.connect.ts where I have exported both direct connect & api connect methods.Now I can use both functionalities anywhere in my app. Incase I want to raw dog SQL, I can just use sql
select * from users; else i can use await supabase.from("users").select('*').I did this because i wasn't able to use complex joins using the api connect. So i can use any one of them when needed.