Help with relations: many-to-many + one-to-one
I'm having trouble figuring out how to model the following relationships between papers, authors, and author's names with Drizzle
Conceptually, the relations are as follows:
I know that I can do the following to return a paper with it's author(s):
But how do I get from the
relations. The schema looks like this (I've ommitted some columns for brevity)Conceptually, the relations are as follows:
- each row in
can be related to many rows inauthorspapers, and each row inpaperscan be related to many rows
(many to many)authors - each row in
authors_to_papersis be associated with one row ofauthors
I know that I can do the following to return a paper with it's author(s):
But how do I get from the
authorIds returned in the output of the above to the firstName and lastName associated with those authorIds?