-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add DB3Document and support add document operation and new-db #302
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #302 +/- ##
==========================================
+ Coverage 48.59% 54.26% +5.67%
==========================================
Files 55 56 +1
Lines 4834 5613 +779
==========================================
+ Hits 2349 3046 +697
- Misses 2485 2567 +82
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
1. use snake case for argument naming 2. make add_owner and add_document_id non public
@@ -64,6 +66,9 @@ impl TxId { | |||
pub fn to_base64(&self) -> String { | |||
base64ct::Base64::encode_string(self.as_ref()) | |||
} | |||
pub fn try_from_base64(input: &str) -> std::result::Result<Self, DB3Error> { | |||
Self::try_from_bytes(base64ct::Base64::decode_vec(input).unwrap().as_slice()) |
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.
replace unwrap()
with map_err
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.
will fix in next pr.
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.
LGTM
This is a part of work from #271
In this PR, we are going to create a document
support create document using command-cli
new-db --addr db_addr --collection-name collection_name --documents document_list
support create document without index
support get document using DocumentId
Given the limit of the PR size, we will implement further document operation including create documents and get document using index/key in the future PR.
Add DocumentId and support add document id, tx id, owner via DB3Document
Put index entry for collection indexes.
CLI command change: collection-id --> collection-name
CMD demo