Replies: 1 comment
-
I have the same request. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I've been reading through some of the drizzle code and I can't quite figure out how to introspect relations after they have been created.
My use-case is that my team is trying to build out a factory_bot like implementation using pgTable() and relations() methods as the source of data, but it doesn't seem like relations are accessible after you've defined them.
An example would be that an organization contains many users, and when we go to create an organization, we should be able to introspect it's relations that we've defined them and create any dependent records that the organizations table needs.
We define the relationship like this today
Has anyone tried anything similar? Trying not to duplicate the relationships in the drizzle code and in some custom factory code.
CC: @brettjnorris
Beta Was this translation helpful? Give feedback.
All reactions