Skip to content

Conversation

@TremblingV5
Copy link
Contributor

This PR is related with #517

  • Add tx.MGet and tx.MSet. Use slices as the returned value.
  • Add tx.Append.
  • Add tx.GetRange. It will get the part by using a closed interval which composed with 2 int

tx.MGet and tx.MSet

  • If calling them with 0 arg. Them will do nothing and return a nil.
  • We must use an even number of args to call tx.MSet. If i is an even number, the ith arg and the i+1th arg will be a pair of k-v.

tx.Append

  • If calling it with a empty appendage, it will do nothing and return a nil
  • If use this method on a non-exist key, it will create a new value with the given appendage.

tx.GetRange

  • Use start and end to be a closed interval and get the part of value by using it. (This is same with Redis)
  • If start is greater than end, it will throw an error.
  • If start is greater than the size of value, it will return a nil
  • If end is greater than the size of value, it will return value[start:]
  • Normally, it will return value[start:end+1]

@TremblingV5 TremblingV5 force-pushed the implements_mset_mget_getrange_append branch from 8047cad to 5d3ace0 Compare December 15, 2023 14:38
@TremblingV5 TremblingV5 marked this pull request as ready for review December 15, 2023 14:39
@codecov
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (556a10b) 70.90% compared to head (5d3ace0) 70.98%.

Files Patch % Lines
tx_btree.go 80.43% 6 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
+ Coverage   70.90%   70.98%   +0.07%     
==========================================
  Files          36       36              
  Lines        5438     5484      +46     
==========================================
+ Hits         3856     3893      +37     
- Misses       1189     1195       +6     
- Partials      393      396       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@bigboss2063 bigboss2063 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@bigboss2063 bigboss2063 merged commit ec06697 into nutsdb:master Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants