sewenew / redis-plus-plus

Redis client written in C++
Apache License 2.0
1.64k stars 351 forks source link

fix hset template param type #489

Closed BeyondWUXF closed 1 year ago

sewenew commented 1 year ago

Thanks for your contribution!

Regards

sewenew commented 1 year ago

After some thoughts, I think it might not be a good idea to return bool for hset. First of all, it's a little confusing to return false for this method (false, does not mean failing to send command, but means this is not a newly add item). Secondly, since hset might take a list of (field, value) pairs, and in that case, it returns a long long. This makes the return type inconsistent.

I'm wondering does this change, i.e. from bool to long long, makes your code incompatible? If you have any idea on it, feel free to share :)

Regards

BeyondWUXF commented 1 year ago

Future<bool> hset(const StringView &key, const StringView &field, const StringView &val) { return _command<bool>(fmt::hset, key, field, val); } This function returns true. So to be consistent, I change long to true. My code can be modified to fit, it doesn't matter

sewenew commented 1 year ago

I've made this breaking change. Please check the latest code on master branch.

Regards

BeyondWUXF commented 1 year ago

I'll try tomorrow.