-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UpdateorCreate #484
Comments
Great relevance, congratulations on the suggestion. |
Meanwhile, I have made this available through a model trait. https://github.com/MZanggl/adonis-lucid-update-or-create |
thetutlage
added a commit
that referenced
this issue
Oct 7, 2019
thetutlage
added a commit
that referenced
this issue
Jan 12, 2020
Hi everyone. When is the new release incorporating this PR being released? Just being curious |
It's already released in the new version of AdonisJS (aka, the Preview of V5). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Why this feature is required (specific use-cases will be appreciated)?
This feature is required when you want to run a lucid query to update or create item in the database
Have you tried any other work arounds?
Yes , i have added a new function that enables be achieve this in
static async updateOrCreate (whereClause, payload, trx) {
if (!payload) {
payload = whereClause
}
}
Are you willing to work on it with little guidance?
Yes
The text was updated successfully, but these errors were encountered: