RedisTimeSeries / redistimeseries-go

golang client lib for RedisTimeSeries
https://redistimeseries.io
Apache License 2.0
65 stars 18 forks source link

Specification of dbNumber in redis connection #140

Open 0x090909 opened 2 years ago

0x090909 commented 2 years ago

I had the need to specify the number of database for the redis connection, by default every client connects to the 0 database, but you can specify whatever integer you want according redigo documentation.

conn, err := redis.Dial("tcp", host)

becomes

conn, err := redis.Dial("tcp", host, redis.DialDatabase(dbNumber))

I thought this might be a useful feature for everybody so I decided to open this pull request.

codecov[bot] commented 2 years ago

Codecov Report

Base: 82.74% // Head: 82.74% // No change to project coverage :thumbsup:

Coverage data is based on head (c23ac3d) compared to base (e83b198). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #140 +/- ## ======================================= Coverage 82.74% 82.74% ======================================= Files 7 7 Lines 591 591 ======================================= Hits 489 489 Misses 59 59 Partials 43 43 ``` | [Impacted Files](https://codecov.io/gh/RedisTimeSeries/redistimeseries-go/pull/140?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RedisTimeSeries) | Coverage Δ | | |---|---|---| | [client.go](https://codecov.io/gh/RedisTimeSeries/redistimeseries-go/pull/140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RedisTimeSeries#diff-Y2xpZW50Lmdv) | `84.95% <100.00%> (ø)` | | | [pool.go](https://codecov.io/gh/RedisTimeSeries/redistimeseries-go/pull/140/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RedisTimeSeries#diff-cG9vbC5nbw==) | `80.43% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RedisTimeSeries). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=RedisTimeSeries)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.