-
Notifications
You must be signed in to change notification settings - Fork 13
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
Dr/kv overhaul #641
Dr/kv overhaul #641
Conversation
Looks good 👍 I wonder if there should be a DbKey type? I guess the choice to not have it is to make it easier for consumers of the API (since they won't have to, e.g., import that type in order to talk to kv)? |
pub enum KvResponse { | ||
Ok, | ||
BeginTx { tx_id: u64 }, | ||
Get { key: Vec<u8> }, | ||
Get(Vec<u8>), |
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.
now that it's no longer super obvious that the vec here is the original key used in the get request, we should at least add a comment that specifies that the returned value will be in the blob
pub struct KvRequest { | ||
pub package_id: PackageId, | ||
pub db: String, | ||
pub action: KvAction, | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize, Clone)] | ||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub enum KvAction { | ||
Open, | ||
RemoveDb, | ||
Set { key: Vec<u8>, tx_id: Option<u64> }, |
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.
same here, //value in blob
please give feedback on kv types,
caps had big vuln, fixed
kv runtime was cloning unnecessarily so refactored some of that out