Choosing the right ORM
Hello, I am building a Next.js project and I have been thinking a lot about what ORM to choose. My first idea was to directly use Supabase client for API, Supabase CLI for migrations and Supabase gen types CLI for generating typescript types, but then i thought that maybe the app should be a bit less dependent on Supabase so i tried out the Prisma ORM.
My problem with prisma is that in the schema i can't define the RLS policies and foreign keys to other schemas, meaning i can not have a single source of truth file for my db.
Then i looked for something that can have the schema defined in raw SQL (so i can write custom queries for RLS and policies) so i tried out drizzle. The problem is that now i need to have one schema file with half typescript and half sql code, which is better than Prisma but still a bit weird.
My question is if I should ditch ORMs and use Supabase and it's CLI completely, I am just starting out this project and I wanna do it right, I am not looking to leave Supabase any time soon but I still wanna make my project futureproof.
My problem with prisma is that in the schema i can't define the RLS policies and foreign keys to other schemas, meaning i can not have a single source of truth file for my db.
Then i looked for something that can have the schema defined in raw SQL (so i can write custom queries for RLS and policies) so i tried out drizzle. The problem is that now i need to have one schema file with half typescript and half sql code, which is better than Prisma but still a bit weird.
My question is if I should ditch ORMs and use Supabase and it's CLI completely, I am just starting out this project and I wanna do it right, I am not looking to leave Supabase any time soon but I still wanna make my project futureproof.