I don't understand why this happens (this is the first time I've encountered this problem).
\nso if you have a solution: I'm interested
\n\n(because I don't want to do an additional SQL query checking the existence or not of the tuple before doing make \"lucid tenant.save()\")
\n
Thank you for your help and have a nice day.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"arfff ...
\nI found my error 'tenant.save()'
\nI had forgotten to put \"await\" in front of 'await tenant.save()' ....
thank you
","upvoteCount":1,"url":"https://github.com/orgs/adonisjs/discussions/4792#discussioncomment-11204700"}}}-
|
Good evening, I use adonis v6 + lucid + mysql 8XXX. So I want to insert a new row into my mysql table. My problem occurs when the mysql driver detects a "duplicate key" error:
here is my code (on controller) : I don't understand why this happens (this is the first time I've encountered this problem).
Thank you for your help and have a nice day. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
arfff ... I found my error thank you |
Beta Was this translation helpful? Give feedback.
arfff ...
I found my error
'tenant.save()'I had forgotten to put
"await"in front of'await tenant.save()'....thank you