selmeci / dgraph-tonic

Async/Sync gRPC client for Dgraph DB
MIT License
83 stars 8 forks source link

Need to be able to control upsert commit now #7

Closed lhr0909 closed 4 years ago

lhr0909 commented 4 years ago

We have an upsert operation used in the middle of a transaction, but right now dgraph-tonic doesn't allow upsert to control whether or not the txn should be committed or not.

Proposing to add two more upsert operations with &mut self and not setting the commit_now flag in the request.

Some reference I have in other client implementations:

https://github.com/dgraph-io/dgo#running-an-upsert-query--mutation https://github.com/dgraph-io/dgraph-js#running-an-upsert-query--mutation

Although the dGraph documentation recommends committing after upsert, we have a long update chain txn that currently will produce wrong side effects if we don't run this upsert in the middle of the txn.

lhr0909 commented 4 years ago

@selmeci by the way I updated the library to match the latest master of yours and it is working quite well! It should make it easier to work with wrapper other types now. Thanks for the help!

Also I am starting to use async clients and it is working in async scenario.

https://github.com/xanthous-tech/dgraph-js-native/pull/3

selmeci commented 4 years ago

Solved with https://github.com/selmeci/dgraph-tonic/releases/tag/v0.6.2