© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago
Mathias

Relations with Drizzle ORM and Supabase

I'm having this Next.js project where I would like to query a user
with
with
their permissions using Drizzle ORM and Supabase. I keep getting the following error when I try to add with into the query as documented here: https://orm.drizzle.team/docs/rqb.

Error message:

Error: Cannot read properties of undefined (reading 'referencedTable')
Error: Cannot read properties of undefined (reading 'referencedTable')


I have already the question up at Stackoverflow since this would not allow me to share the code as it is too long.

Link to thread:
https://stackoverflow.com/questions/77780541/how-to-declare-and-query-with-relations-using-drizzle

I hope you can see what I do wrong. Your help is much appreciated 🙏
Stack Overflow
How to declare and query with relations using Drizzle?
I'm having this Next.js project where I would like to query a user with their permissions using Drizzle ORM and Supabase. I keep getting the following error when I try to add with into the query as
How to declare and query with relations using Drizzle?
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

SQL to supabase orm
SupabaseSSupabase / help-and-questions
3y ago
how to client side query with drizzle ORM?
SupabaseSSupabase / help-and-questions
7mo ago
Recommended ORM for supabase + Dart Flutter
SupabaseSSupabase / help-and-questions
4y ago
Get Full DB Schema for Drizzle ORM
SupabaseSSupabase / help-and-questions
4mo ago