dgraph-io / badger

Fast key-value DB in Go.
https://dgraph.io/badger
Apache License 2.0
13.88k stars 1.18k forks source link

[enhancement] Using WriteBatch with OpenManaged #629

Closed svmhdvn closed 5 years ago

svmhdvn commented 5 years ago

I'm trying to do a lot of bulk writes on a managed DB. Currently, WriteBatch uses the unmanaged transactions API, so the only way I can do bulk writes is by managing my own transactions. It would be convenient to be able to use a similar API for WriteBatches with a managed DB, since I need the commitAt functionality for other transactions.

gitlw commented 5 years ago

Thanks @svmhdvn for raising this. PR submitted and waiting for review from other devs in the Dgraph team.

manishrjain commented 5 years ago

@svmhdvn : You can also use the TxnWriter available in Dgraph: x/badger.go, if you're going to use this for a Dgraph binary.

campoy commented 5 years ago

Is this something we still want to work on? An old PR #633 was created and eventually abandoned.

Hey @svmhdvn, did the recommendation above fix your issue?

campoy commented 5 years ago

Closing as there's a work around using TxnWriter.

Please, reopen if the workaround is not sufficient.