Skip to content
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

Support raw redis client #371

Closed
c1ay opened this issue Mar 8, 2019 · 3 comments
Closed

Support raw redis client #371

c1ay opened this issue Mar 8, 2019 · 3 comments

Comments

@c1ay
Copy link

c1ay commented Mar 8, 2019

In some situation, I need to use some method like hget, hset (cache not provide). How can I access the raw redis client?

@niwinz
Copy link
Collaborator

niwinz commented Mar 8, 2019

yes, it is already supported, http://niwinz.github.io/django-redis/latest/#_raw_client_access

@niwinz niwinz closed this as completed Mar 8, 2019
@pbysh
Copy link

pbysh commented Mar 15, 2019

I don't understand why every single request for hset and hget gets closed with "it's already supported" with a link to the raw client access. At that point, why not take out set and get since it's already supported by the native client? I am baffled that the most popular django redis back-end seemingly refuses to support these functions within their API and instead forces users to go directly to the native client, in which one doesn't get the compression, serialization, and versioning functionality that make it worthwhile to use django-redis.

@niwinz
Copy link
Collaborator

niwinz commented Mar 15, 2019

@pbysh This issue is opened with a clear question: "can I access the raw redis client?" and the response is adecuatate for the original question.

About your concern: I have expressed that im pretty reluctant to expand the default client public interface because it should satisfy the django cache backend interface in all aspects (key versioning, key prefixing etc etc...) adding redis native comand as is is not a solution, we will need make them work in the django cache backend semantics.

And I also expressed my concern many times about adding more and more api to an client object that is designed to be swapeable with other backends (adding exclusive methods to client object, couples a lot the use of the cache django backend to specific backend, if you want coupling, just use a native client and do it explicit, IMHO).

Your example about taking out get and set is absurd because you dont care about all the semantics differences between the django cache client and the native client.

In any case im not completly rejecting adding more methods. Im rejecting adding more methods by the unique reason like we can do it or why not?. Open a separate issue for that, give me a good rationale about adding a specific method and that use cases solves (better than using native client, reminder about behavior semantics differences) and i will consider the addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants