acmpesuecc / acmpesuecc/Onyx

Create a `NewTransaction` function

Đang mở
#6 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
Bounty: 50 enhancement good first issue
Ngôn ngữ chính
Go
Star
3
Fork
2
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Currently all the functions of onyx take in a `*badger.Txn` as their final argument which lets the user pass in a transaction under which the graph operation should be executed. However, currently there is no way for users of Onyx to actually create a new `*badger.Txn` without calling `graph.DB.NewTransaction()`, which requires the `DB` field of the `Graph` struct to be publicly exposed, which is not ideal.

Create a function `NewTransaction` on the `Graph` struct which returns a `*badger.Txn` for the users to use. Note that `NewTransaction` should take in a boolean which tells it if a read-only txn or a read-write txn.

Remember to create a unit test for this function!

_psst, remember to update the usage guide in the README too_ 👀

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.