-
Notifications
You must be signed in to change notification settings - Fork 574
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
Only request returning attribute if client supports returning #1770
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, but the test suite must pass before this gets merged.
@ricardograca Thanks, I've updated the PR to pass the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something that probably should be abstracted away in knex, but for now we'll handle it.
Hi, I am struggling with returning keyword as AWS Redshift does not support it. Please let me know how should i configure in Bookshelf.js. I am using "bookshelf": "^1.0.0" , "knex": "^0.19.4" and "pg": "^7.12.1" Please guide |
AWS Redshift is not in the list of clients that support |
The problem is that that Redshift is pg compliant, and so I'm assuming @sachincloudnaut uses pg driver, which do support it - while Redshift does not. So Bookshelf thinks this is fine, Redshift disagrees. |
Let's continue the discussion in #2024. |
Introduction
knex
0.14.4 has been updated such that a warning is logged when using thereturning
attribute in a SQL dialect that does not support it.bookshelf
always requests areturning
attribute during aninsert
, which causes a flood of unwarranted warning messages whenever sqlite3 is used, and there is no way to tellbookshelf
not to specifyreturning
.Motivation
When running my tests, I see warning messages like this flood my logs every time I call an
insert
:Proposed solution
My solution is to check if the current client supports
returning
and request theidAttribute
if and only if the support is available.Current PR Issues
N/A
Alternatives considered
Also considered updating the client within
knex
to be able to do this logic. However, due to the fact that this change was implemented on theknex
side, I have to assume that this is intended behavior.