Skip to content
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

Returning option in save method #2116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Plaffont
Copy link

@Plaffont Plaffont commented Sep 8, 2021

Introduction

Knex provide a returning method when an insert or update query is built. This pull request allow the same option in the save method in bookshelf.

Proposed solution

The solution consist in passing the returning option during the building of the knex query.
And then when the resulting object is retrived we clear the model in order to have only the desired columns.

Current PR Issues

The option is not built for database without RETURNING statement (I do not have one for test right now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant