Create a `NewTransaction` function
- 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
Đánh giá
Issue này chưa được đánh giá.