kragniz / kragniz/python-etcd3
Prefix operations in transactions.
- Dominant language
- Python
- Stars
- 450
- Forks
- 194
- PR merge metrics
- No merged PRs in 30d
Description
It currently isn't very easy to perform prefix operations inside transactions.
I can see a few ways to do this in the API:
1. make `utils.increment_last_byte` public, so it can be used to create the `range_end` argument
2. add new GetPrefix, and DeletePrefix operations to transactions
3. add a keyward argument to the get and delete operations to specify using a prefix instead of a single item
I think I prefer 2. I'd be happy to implement any of these solutions.
By the way, I think the current implementation of `utils.increment_last_byte` won't work as expected if the last byte of the key is 0xff. It will throw a ValueError, in that case it should probably increment the second to last byte (and so on)
Contributor guide
Research direction
Start by reading the transaction operations and utils.increment_last_byte mentioned in the issue. Compare the three proposed API approaches, with particular attention to prefix Get/Delete behavior and keys ending in 0xff. Done means the chosen transaction API is implemented and the increment_last_byte edge case is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100