Open mjrusso opened 14 years ago
A while back I implemented a small class to do this. I called it a "keyspace" and basically it took care of the prefix (i.e. namespace) and also had a hash which kept track of all the keys created in the namespace. It also had some capability to manage TTL on keys and a few other things. The api was/is more or less:
foo = keyspace("foo") foo.key = "foo" foo.mkey("bar") = "foo.bar"
It's not really complicated to implement, and whatever you do, it probably will not hit my use-case exactly. So is it really something that belongs as a part of redis-py? It could be better as a separate project.
Year 2047, this feature still not implemented
+10000000000000000000000000000000000000000000000000000000000000000000
+1. This feature would be very useful for enforcing data isolation in a multi-tenancy use case where different client instances may use the same database but shouldn't touch each other's keys.
+1
+1
👀
+1
+1
+1 - Would help with multi tenancy solutions with shared db
+1
any good news for this one!?
maybe something like this being implemented in the main package!?
Proposal:
Behind-the-scenes, this would prefix every key with
foobar
.For example, if I issued the following command:
It would be equivalent to the following:
In Ruby, the redis-namespace class does the same thing.
However, I think that it would be preferable if this were a core feature of the Python client.