Change the currently selected DB. Returns an error if the id * is out of range. * * Note that the client will retain the currently selected DB even after * the Redis command implemented by the module calling this function * returns. * * If the module command wishes to change something in a different DB and * returns back to the original one, it should call RedisModule_GetSelectedDb() * be
| 2291 | * returns back to the original one, it should call RedisModule_GetSelectedDb() |
| 2292 | * before in order to restore the old DB number before returning. */ |
| 2293 | int RM_SelectDb(RedisModuleCtx *ctx, int newid) { |
| 2294 | int retval = selectDb(ctx->client,newid); |
| 2295 | return (retval == C_OK) ? REDISMODULE_OK : REDISMODULE_ERR; |
| 2296 | } |
| 2297 | |
| 2298 | /* Initialize a RedisModuleKey struct */ |
| 2299 | static void moduleInitKey(RedisModuleKey *kp, RedisModuleCtx *ctx, robj *keyname, robj *value, int mode){ |
nothing calls this directly
no test coverage detected