-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): add documents of db
#888
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# DB | ||
|
||
The `db` package contains the key-value database interface and `memdb` implementation. The `memdb` is a simple in-memory key-value store that is used for testing and development purposes. | ||
|
||
## Context | ||
|
||
The main purpose of the `db` package is to provide decoupling between `cosmos-db` and `iavl` packages. It provides a simple `wrapper` for the old users of `iavl` and `cosmos-db` to use the new `db` package without changing their code. For example: | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"cosmossdk.io/log" | ||
dbm "github.com/cosmos/cosmos-db" | ||
|
||
"github.com/cosmos/iavl" | ||
idbm "github.com/cosmos/iavl/db" | ||
) | ||
|
||
func main() { | ||
levelDB, err := dbm.NewDB("application", dbm.GoLevelDBBackend, "test") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
tree := iavl.NewMutableTree(idbm.NewWrapper(dbm.NewPrefixDB(levelDB, []byte("s/k:main/"))), 0, false, log.NewNopLogger()) | ||
} | ||
``` | ||
Comment on lines
+1
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The README.md provides a clear overview of the
Overall, the documentation is a good starting point but could be enhanced to offer more guidance and information to users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The improvements listed in the Unreleased section of the CHANGELOG.md accurately reflect the significant changes made to the project, including the decoupling from
cosmos-db
, introduction of new APIs, and performance optimizations. However, it would be beneficial to include more context or details for each item to help users understand the impact of these changes better. For example:cosmos-db
, briefly explain the benefits or reasons behind this move.SaveChangeSet
,NewCompressExporter
, andNewCompressImporter
, a short description of their use cases or advantages would be helpful.Enhancing the descriptions in the CHANGELOG.md will provide users with a clearer understanding of the changes and how they can benefit from them.