I'm using supabase as a backend but want to have a fully reproducible database, meaning everything that runs must be on a file in my codebase - no manual steps on the UI
for that reason I'm using drizzle as an ORM, which can push and migrate my schema to supabase with drizzle kit
the thing is it seems the only way to make use of RLS and postgrest to query the database from the client side is to use the supabase client library
the problem is that the supabase client can't see the drizzle ORM types
so to have type safe code I would have to
1. write my schema with drizzle ORM
2. push schema to supabase
3. generate typescript types with supabase
4. pass the generated types to supabase client
you can see how this is quite cumbersome - ideally, it would just be
1. write schema with drizzle ORM
2. supabase client relies on that schema
or maybe something else - I just need a way to query the database in a type safe way from the client side, making use of RLS for authorization
has anyone set up something like this and would be able to share how they achieved it? thanks!