rueidis icon indicating copy to clipboard operation
rueidis copied to clipboard

feat: add unit field to bitcount

Open SoulPancake opened this issue 1 year ago • 9 comments

fixes

  • #526

SoulPancake avatar Apr 26 '24 18:04 SoulPancake

@rueian Do we need to also do it for func (c CacheCompat) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd for this to work?

SoulPancake avatar Apr 26 '24 18:04 SoulPancake

CacheCompat) BitCount(ctx context.Context, ke

Yes, we should support the Unit there too.

rueian avatar Apr 27 '24 03:04 rueian

Hi @SoulPancake, would you like to continue on this?

rueian avatar May 11 '24 11:05 rueian

yes give me some time I will address it tonight @rueian

SoulPancake avatar May 11 '24 11:05 SoulPancake

@rueian I was thinking whether I should continue here or on valkey-go You can suggest

SoulPancake avatar May 16 '24 16:05 SoulPancake

Hi @SoulPancake,

Here is ok. I will sync commits between them.

rueian avatar May 16 '24 16:05 rueian

Will that make me a contributor there too? As I would like to be so @rueian

SoulPancake avatar May 16 '24 16:05 SoulPancake

Will that make me a contributor there too? As I would like to be so @rueian

Yes of course

rueian avatar May 16 '24 16:05 rueian

I have some doubts The command slice looks alright to me image

But still I am getting an ERR syntax error for this However, it works fine for BIT

@rueian

SoulPancake avatar May 16 '24 18:05 SoulPancake

Further, In the container that I am using, I am able to get the response too image

SoulPancake avatar May 17 '24 05:05 SoulPancake

I have some doubts The command slice looks alright to me image

But still I am getting an ERR syntax error for this However, it works fine for BIT

@rueian

Do you mean here? The RESP2 test suite is tested against Redis 5. image

You need to wrap your new tests in a if block:

		if resp3 {
			bitCount = adapter.BitCount(ctx, "key", &BitCount{
				Start: 1,
				End:   1,
				Unit:  "BYTE",
			})
			Expect(bitCount.Err()).NotTo(HaveOccurred())
			Expect(bitCount.Val()).To(Equal(int64(6)))	
		}

rueian avatar May 17 '24 12:05 rueian

Please review @rueian :)

SoulPancake avatar May 17 '24 15:05 SoulPancake

LGTM. Thanks @SoulPancake!

rueian avatar May 18 '24 09:05 rueian