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 * not allowed with current code #132

Closed
tonyd256 opened this issue Dec 10, 2013 · 4 comments
Closed

RETURNING * not allowed with current code #132

tonyd256 opened this issue Dec 10, 2013 · 4 comments

Comments

@tonyd256
Copy link

@tonyd256 tonyd256 commented Dec 10, 2013

I'd like to be able to use RETURNING * at the end of insert and update statements. However, returning is implemented so you can only receive one column back. This could be fixed by eliminating the double quotes surrounding qb.flags.returning on line 43 in clients/server/postgres/grammar.js and by returning rows in the handleResponse function just below for INSERTs and UPDATEs. I could make these changes and submit a PR if you'd like but these changes might break existing implementations.

@tgriesser tgriesser closed this in 10e3d39 Dec 10, 2013
@tgriesser
Copy link
Member

@tgriesser tgriesser commented Dec 10, 2013

Hey @tonyd256 - thanks for pointing that out, take a look at the latest commit and see if that looks good... I'll look to roll that into a new patch release in the next day or so.

@tonyd256
Copy link
Author

@tonyd256 tonyd256 commented Dec 10, 2013

@tgriesser Awesome!! thanks man! I just tested it out with returning('*') and returning(['col1', 'col2']) with an insert statement and it worked great. It still doesn't allow the returning statement for updates but the insert one was the one I really needed anyway.

tgriesser added a commit that referenced this issue Dec 10, 2013
@tgriesser
Copy link
Member

@tgriesser tgriesser commented Dec 10, 2013

@tonyd256 should allow for them on updates now.

@lancecarlson
Copy link

@lancecarlson lancecarlson commented Aug 11, 2015

Can the documentation be updated to reflect this change? Latest docs only show that you can pass one argument.

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

Successfully merging a pull request may close this issue.

None yet
3 participants