-
Notifications
You must be signed in to change notification settings - Fork 0
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
Spike: returning a record replacement with glide strings. #418
Spike: returning a record replacement with glide strings. #418
Conversation
Signed-off-by: Yury-Fridlyand <[email protected]>
node/src/BaseClient.ts
Outdated
|
||
// GLideRecord for score for sorted set commands? | ||
// TODO export | ||
export type ElementScoreData = { element: GlideString; score: number }[]; |
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.
yes, I agree. This way you explicitly convey that this data type is meant for storing elements and their associated scores. This is more explicit than using GlideRecord , where the meaning of "key" and "value" might be less obvious without additional comments
node/src/BaseClient.ts
Outdated
}); | ||
} | ||
|
||
/** Downcast `GlideRecord` to `Record`. Use if you are 146% aware that `data` keys are always strings. */ |
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.
146?
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.
When 100% is not enough
node/src/BaseClient.ts
Outdated
): Promise<Record<string, [string, string][]> | null> { | ||
return this.createWritePromise(createXRevRange(key, end, start, count)); | ||
options?: { count?: number } & DecoderOption, | ||
): Promise<{ entryID: GlideString; data: [string, string][] }[] | null> { |
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.
Does the data not need to be a GlideString?
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.
Yes, it is a user data
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.
Update: entry ID could be given by the user, but it is still in number-like format (to be precise: "<uint>-<uint>"
). I updated it by introducing
export type StreamEntryDataType = Record<string, [GlideString, GlideString][]>;
Data is user data, which could contain anything
Co-authored-by: Andrew Carbonetto <[email protected]>
3e9264f
into
node/integ-yuryf-valkey-292-mget-mset
TODO:
ClusterValue
zadd
- used in examples of other commands)List of commands:
LMPOP
BLMPOP
BZMPOP
ZPOPMIN
ZPOPMAX
ZMPOP
ZDIFFWITHSCORES
ZINTERWITHSCORES
ZUNIONWITHSCORES
HGETALL
LSCIDX
- no return type changePUBSUB NUMSUB
XRANGE
- no return type changeXREVRANGE
- no return type changeXINFO GROUPS
- no return type changeXINFO CONSUMERS
- no return type changeXINFO STREAM
- no return type changeXCLAIM
- no return type changeXAUTOCLAIM
- no return type changeXREAD
XREADGROUP