question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

when chaining update calls, only the last takes effect

See original GitHub issue

Whereas where calls can be chained like so:

> knex('foo').where('a', 1).where('b', 2).toString()
'select * from "foo" where "a" = \'1\' and "b" = \'2\''

update calls cannot:

> knex('foo').update('a', 1).update('b', 2).toString()
'update "foo" set "b" = \'2\''

May not exactly be a bug, but the difference has me wondering whether this is by design.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
joaonicecommented, Sep 19, 2016

@rhys-vdw @wubzz Any update on this?

1reaction
simonecognocommented, Feb 13, 2017

Seems like in PR #1437 there is problem to implement the chaining insert but it seems that there is no problem with the chaining increment. Any chance to add at least the chaining increment? Or is there a workaroud that avoid to make X separate queries for incrementing x fields?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trouble chaining useEffects to use updated state from ...
I don't see it as a dependency since it's not referenced in the hook callback. When currentUser changes it will trigger both effects...
Read more >
Promises chaining - The Modern JavaScript Tutorial
Here the first .then shows 1 and returns new Promise(…) in the line (*) . After one second it resolves, and the result...
Read more >
Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
The optional chaining (?.) operator accesses an object's property or calls a function. If the object accessed or function called is ...
Read more >
Injecting side effects into chained Sequence operations
When you call a method like map on a value that conforms to LazySequenceProtocol , the compiler will favor the lazy variant of...
Read more >
Constructor Chaining In Java with Examples - GeeksforGeeks
Constructor chaining is the process of calling one constructor from another constructor with respect to current object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found