© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•7mo ago•
16 replies
Marcos Pereira

how to client side query with drizzle ORM?

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!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

query exposed on client side
SupabaseSSupabase / help-and-questions
12mo ago
Relations with Drizzle ORM and Supabase
SupabaseSSupabase / help-and-questions
3y ago
Can you mix server-side client with client-side client (NextJS)?
SupabaseSSupabase / help-and-questions
13mo ago
Client Side Oauth?
SupabaseSSupabase / help-and-questions
13mo ago