If bulk_create doesn't support IntField Primary Keys, how or why would I even use it? #1579
Unanswered
PancakePuncher
asked this question in
Q&A
Replies: 1 comment
-
It seems really strange to me. what happen if you run this ? questions = [
Questions(question_text="", question_category="", question_type="", question_scope=""),
Questions(question_text="", question_category="", question_type="", question_scope="")
]
await Questions.bulk_create(questions) |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am curious if anyone has a solution to this?
Other then a for loop on a single "create" method.
The issue is that when I attempt to do a bulk_create on the table Schema below. I get an error stating that I am missing the "_custom_primary_key". I do not expect the incoming objects to include the ID of the record. I want this to be generated every time a record is created.
My Objects come in like this using Pydantic Models:
I attempted filling in the "pk_question_id" with a None to see if that would force it to generate it, but no luck.
Schema For Reference
But the bulk_create documentation says this...
This seems kind of insane to me -- is their a way to work around this behavior? Because so far I haven't found any documentation on this.
Beta Was this translation helpful? Give feedback.
All reactions