Replies: 1 comment
-
I am far from an expert but I think this discussion might be what you're looking for: |
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!
I have a deeply interconnected schema with a lot of foreign keys on various tables. I am trying to handle these using the [Reference] attribute but I am running into some problems, likely due to me simply not understanding how the attribute works correctly.
Given the following models
And the database schema
How can I insert into the table
foo
and set the foreign key ofbar
? I have tried a few different things but nothing seems to work correctlyI have tried
[Column]
attribute to the reference, this results in the errorinvalid input syntax for type uuid
from postgrestpublic Guid bar_id
property to thefoo
model and populating this separately for inserts, this works somewhat fine but is messy, requiring two unique properties on every model, one for queries and one for inserts, there has to be a better wayAre there any examples out there of inserting foreign key data with the models and schemas?
Beta Was this translation helpful? Give feedback.
All reactions