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

Added error if chaining update/insert/etc with first() #2506

Merged

Conversation

@wubzz
Copy link
Member

@wubzz wubzz commented Feb 22, 2018

Fixes #2061

This throws error in for example

knex(table)
.update({column: value})
.first();

But does not throw for

knex(table)
.first()
.update({column: value});

Since the latter correctly generates an update query.

elhigu
elhigu approved these changes Feb 22, 2018
Copy link
Member

@elhigu elhigu left a comment

It sounds kind of wrong that the latter one is not throwing an error even that .update() removes LIMIT 1 from the query.

Anyways I'm ok with this.

@wubzz wubzz merged commit ad1062b into knex:master Feb 22, 2018
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants