diff --git a/src/NRedisStack/Auxiliary.cs b/src/NRedisStack/Auxiliary.cs index c336431d..0cafae96 100644 --- a/src/NRedisStack/Auxiliary.cs +++ b/src/NRedisStack/Auxiliary.cs @@ -6,12 +6,12 @@ namespace NRedisStack; public static class Auxiliary { - private static string? _libraryName = $"NRedisStack(.NET_v{Environment.Version})"; + private static string? _libraryName = $"NRedisStack-{GetNRedisStackVersion()}"; private static bool _setInfo = true; public static void ResetInfoDefaults() { _setInfo = true; - _libraryName = $"NRedisStack(.NET_v{Environment.Version})"; + _libraryName = $"NRedisStack-{GetNRedisStackVersion()}"; } public static List MergeArgs(RedisKey key, params RedisValue[] items) { @@ -126,4 +126,7 @@ public static string GetNRedisStackVersion() Version version = typeof(Auxiliary).Assembly.GetName().Version!; return $"{version.Major}.{version.Minor}.{version.Build}"; } + + internal static string GetNRedisStackLibName() => _libraryName!; + } \ No newline at end of file diff --git a/src/NRedisStack/CoreCommands/CoreCommands.cs b/src/NRedisStack/CoreCommands/CoreCommands.cs index 9af50645..7a093761 100644 --- a/src/NRedisStack/CoreCommands/CoreCommands.cs +++ b/src/NRedisStack/CoreCommands/CoreCommands.cs @@ -4,11 +4,15 @@ namespace NRedisStack; +/// +/// Class that provides access to some of blocking Redis core commands +/// public static class CoreCommands { /// /// Sets information specific to the client or connection. /// + /// The class where this extension method is applied. /// which attribute to set /// the attribute value /// if the attribute name was successfully set, Error otherwise. diff --git a/src/NRedisStack/CoreCommands/CoreCommandsAsync.cs b/src/NRedisStack/CoreCommands/CoreCommandsAsync.cs index 8ab5eb99..f78a82d1 100644 --- a/src/NRedisStack/CoreCommands/CoreCommandsAsync.cs +++ b/src/NRedisStack/CoreCommands/CoreCommandsAsync.cs @@ -15,12 +15,20 @@ public static class CoreCommandsAsync //: ICoreCommandsAsync /// public static async Task ClientSetInfoAsync(this IDatabaseAsync db, SetInfoAttr attr, string value) { - var compareVersions = db.Multiplexer.GetServer(db.Multiplexer.GetEndPoints()[0]).Version.CompareTo(new Version(7, 1, 242)); - if (compareVersions < 0) // the server does not support the CLIENT SETNAME command + IServer server = db.Multiplexer.GetServer(db.Multiplexer.GetEndPoints()[0]); + return await server.ClientSetInfoAsync(attr, value); + } + + internal static async Task ClientSetInfoAsync(this IServer server, SetInfoAttr attr, string value) + { + var compareVersions = server.Version.CompareTo(new Version(7, 1, 242)); + if (compareVersions < 0) // the server does not support the CLIENT SETINFO command { return false; } - return (await db.ExecuteAsync(CoreCommandBuilder.ClientSetInfo(attr, value))).OKtoBoolean(); + await server.Multiplexer.GetDatabase().ExecuteAsync(CoreCommandBuilder.ClientSetInfo(attr, value)); + var cmd = CoreCommandBuilder.ClientSetInfo(attr, value); + return (await server.ExecuteAsync(cmd.Command, cmd.Args)).OKtoBoolean(); } /// diff --git a/src/NRedisStack/DatabaseWrapper.cs b/src/NRedisStack/DatabaseWrapper.cs new file mode 100644 index 00000000..7e897c29 --- /dev/null +++ b/src/NRedisStack/DatabaseWrapper.cs @@ -0,0 +1,2410 @@ +using StackExchange.Redis; +using System; +using System.Net; + +namespace NRedisStack.RedisStackCommands +{ + internal class DatabaseWrapper : IDatabase + { + protected readonly IDatabase _db; + + public DatabaseWrapper(IDatabase db) + { + _db = db ?? throw new ArgumentNullException(nameof(db)); + } + + public int Database => _db.Database; + + public IConnectionMultiplexer Multiplexer => _db.Multiplexer; + + public IBatch CreateBatch(object? asyncState = null) + { + return _db.CreateBatch(asyncState); + } + + public ITransaction CreateTransaction(object? asyncState = null) + { + return _db.CreateTransaction(asyncState); + } + + public RedisValue DebugObject(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.DebugObject(key, flags); + } + + public Task DebugObjectAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.DebugObjectAsync(key, flags); + } + + public RedisResult Execute(string command, params object[] args) + { + return _db.Execute(command, args); + } + + public RedisResult Execute(string command, ICollection args, CommandFlags flags = CommandFlags.None) + { + return _db.Execute(command, args, flags); + } + + public Task ExecuteAsync(string command, params object[] args) + { + return _db.ExecuteAsync(command, args); + } + + public Task ExecuteAsync(string command, ICollection? args, CommandFlags flags = CommandFlags.None) + { + return _db.ExecuteAsync(command, args, flags); + } + + public bool GeoAdd(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAdd(key, longitude, latitude, member, flags); + } + + public bool GeoAdd(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAdd(key, value, flags); + } + + public long GeoAdd(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAdd(key, values, flags); + } + + public Task GeoAddAsync(RedisKey key, double longitude, double latitude, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAddAsync(key, longitude, latitude, member, flags); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry value, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAddAsync(key, value, flags); + } + + public Task GeoAddAsync(RedisKey key, GeoEntry[] values, CommandFlags flags = CommandFlags.None) + { + return _db.GeoAddAsync(key, values, flags); + } + + public double? GeoDistance(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + return _db.GeoDistance(key, member1, member2, unit, flags); + } + + public Task GeoDistanceAsync(RedisKey key, RedisValue member1, RedisValue member2, GeoUnit unit = GeoUnit.Meters, CommandFlags flags = CommandFlags.None) + { + return _db.GeoDistanceAsync(key, member1, member2, unit, flags); + } + + public string?[] GeoHash(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.GeoHash(key, members, flags); + } + + public string? GeoHash(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoHash(key, member, flags); + } + + public Task GeoHashAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.GeoHashAsync(key, members, flags); + } + + public Task GeoHashAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoHashAsync(key, member, flags); + } + + public GeoPosition?[] GeoPosition(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.GeoPosition(key, members, flags); + } + + public GeoPosition? GeoPosition(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoPosition(key, member, flags); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.GeoPositionAsync(key, members, flags); + } + + public Task GeoPositionAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoPositionAsync(key, member, flags); + } + + public GeoRadiusResult[] GeoRadius(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRadius(key, member, radius, unit, count, order, options, flags); + } + + public GeoRadiusResult[] GeoRadius(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRadius(key, longitude, latitude, radius, unit, count, order, options, flags); + } + + public Task GeoRadiusAsync(RedisKey key, RedisValue member, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRadiusAsync(key, member, radius, unit, count, order, options, flags); + } + + public Task GeoRadiusAsync(RedisKey key, double longitude, double latitude, double radius, GeoUnit unit = GeoUnit.Meters, int count = -1, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRadiusAsync(key, longitude, latitude, radius, unit, count, order, options, flags); + } + + public bool GeoRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRemove(key, member, flags); + } + + public Task GeoRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.GeoRemoveAsync(key, member, flags); + } + + public GeoRadiusResult[] GeoSearch(RedisKey key, RedisValue member, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearch(key, member, shape, count, demandClosest, order, options, flags); + } + + public GeoRadiusResult[] GeoSearch(RedisKey key, double longitude, double latitude, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearch(key, longitude, latitude, shape, count, demandClosest, order, options, flags); + } + + public long GeoSearchAndStore(RedisKey sourceKey, RedisKey destinationKey, RedisValue member, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, bool storeDistances = false, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAndStore(sourceKey, destinationKey, member, shape, count, demandClosest, order, storeDistances, flags); + } + + public long GeoSearchAndStore(RedisKey sourceKey, RedisKey destinationKey, double longitude, double latitude, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, bool storeDistances = false, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAndStore(sourceKey, destinationKey, longitude, latitude, shape, count, demandClosest, order, storeDistances, flags); + } + + public Task GeoSearchAndStoreAsync(RedisKey sourceKey, RedisKey destinationKey, RedisValue member, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, bool storeDistances = false, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAndStoreAsync(sourceKey, destinationKey, member, shape, count, demandClosest, order, storeDistances, flags); + } + + public Task GeoSearchAndStoreAsync(RedisKey sourceKey, RedisKey destinationKey, double longitude, double latitude, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, bool storeDistances = false, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAndStoreAsync(sourceKey, destinationKey, longitude, latitude, shape, count, demandClosest, order, storeDistances, flags); + } + + public Task GeoSearchAsync(RedisKey key, RedisValue member, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAsync(key, member, shape, count, demandClosest, order, options, flags); + } + + public Task GeoSearchAsync(RedisKey key, double longitude, double latitude, GeoSearchShape shape, int count = -1, bool demandClosest = true, Order? order = null, GeoRadiusOptions options = GeoRadiusOptions.Default, CommandFlags flags = CommandFlags.None) + { + return _db.GeoSearchAsync(key, longitude, latitude, shape, count, demandClosest, order, options, flags); + } + + public long HashDecrement(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.HashDecrement(key, hashField, value, flags); + } + + public double HashDecrement(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + return _db.HashDecrement(key, hashField, value, flags); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.HashDecrementAsync(key, hashField, value, flags); + } + + public Task HashDecrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + return _db.HashDecrementAsync(key, hashField, value, flags); + } + + public bool HashDelete(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashDelete(key, hashField, flags); + } + + public long HashDelete(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashDelete(key, hashFields, flags); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashDeleteAsync(key, hashField, flags); + } + + public Task HashDeleteAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashDeleteAsync(key, hashFields, flags); + } + + public bool HashExists(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashExists(key, hashField, flags); + } + + public Task HashExistsAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashExistsAsync(key, hashField, flags); + } + + public ExpireResult[] HashFieldExpire(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldExpire(key, hashFields, expiry, when, flags); + } + + public ExpireResult[] HashFieldExpire(RedisKey key, RedisValue[] hashFields, DateTime expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldExpire(key, hashFields, expiry, when, flags); + } + + public Task HashFieldExpireAsync(RedisKey key, RedisValue[] hashFields, TimeSpan expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldExpireAsync(key, hashFields, expiry, when, flags); + } + + public Task HashFieldExpireAsync(RedisKey key, RedisValue[] hashFields, DateTime expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldExpireAsync(key, hashFields, expiry, when, flags); + } + + public long[] HashFieldGetExpireDateTime(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldGetExpireDateTime(key, hashFields, flags); + } + + public Task HashFieldGetExpireDateTimeAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldGetExpireDateTimeAsync(key, hashFields, flags); + } + + public long[] HashFieldGetTimeToLive(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldGetTimeToLive(key, hashFields, flags); + } + + public Task HashFieldGetTimeToLiveAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldGetTimeToLiveAsync(key, hashFields, flags); + } + + public PersistResult[] HashFieldPersist(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldPersist(key, hashFields, flags); + } + + public Task HashFieldPersistAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashFieldPersistAsync(key, hashFields, flags); + } + + public RedisValue HashGet(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashGet(key, hashField, flags); + } + + public RedisValue[] HashGet(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashGet(key, hashFields, flags); + } + + public HashEntry[] HashGetAll(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetAll(key, flags); + } + + public Task HashGetAllAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetAllAsync(key, flags); + } + + public Task HashGetAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetAsync(key, hashField, flags); + } + + public Task HashGetAsync(RedisKey key, RedisValue[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetAsync(key, hashFields, flags); + } + + public Lease? HashGetLease(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetLease(key, hashField, flags); + } + + public Task?> HashGetLeaseAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashGetLeaseAsync(key, hashField, flags); + } + + public long HashIncrement(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.HashIncrement(key, hashField, value, flags); + } + + public double HashIncrement(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + return _db.HashIncrement(key, hashField, value, flags); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.HashIncrementAsync(key, hashField, value, flags); + } + + public Task HashIncrementAsync(RedisKey key, RedisValue hashField, double value, CommandFlags flags = CommandFlags.None) + { + return _db.HashIncrementAsync(key, hashField, value, flags); + } + + public RedisValue[] HashKeys(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashKeys(key, flags); + } + + public Task HashKeysAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashKeysAsync(key, flags); + } + + public long HashLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashLength(key, flags); + } + + public Task HashLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashLengthAsync(key, flags); + } + + public RedisValue HashRandomField(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomField(key, flags); + } + + public Task HashRandomFieldAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomFieldAsync(key, flags); + } + + public RedisValue[] HashRandomFields(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomFields(key, count, flags); + } + + public Task HashRandomFieldsAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomFieldsAsync(key, count, flags); + } + + public HashEntry[] HashRandomFieldsWithValues(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomFieldsWithValues(key, count, flags); + } + + public Task HashRandomFieldsWithValuesAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.HashRandomFieldsWithValuesAsync(key, count, flags); + } + + public IEnumerable HashScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) + { + return _db.HashScan(key, pattern, pageSize, flags); + } + + public IEnumerable HashScan(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.HashScan(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public IAsyncEnumerable HashScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.HashScanAsync(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public IEnumerable HashScanNoValues(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.HashScanNoValues(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public IAsyncEnumerable HashScanNoValuesAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.HashScanNoValuesAsync(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public void HashSet(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) + { + _db.HashSet(key, hashFields, flags); + } + + public bool HashSet(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashSet(key, hashField, value, when, flags); + } + + public Task HashSetAsync(RedisKey key, HashEntry[] hashFields, CommandFlags flags = CommandFlags.None) + { + return _db.HashSetAsync(key, hashFields, flags); + } + + public Task HashSetAsync(RedisKey key, RedisValue hashField, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.HashSetAsync(key, hashField, value, when, flags); + } + + public long HashStringLength(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashStringLength(key, hashField, flags); + } + + public Task HashStringLengthAsync(RedisKey key, RedisValue hashField, CommandFlags flags = CommandFlags.None) + { + return _db.HashStringLengthAsync(key, hashField, flags); + } + + public RedisValue[] HashValues(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashValues(key, flags); + } + + public Task HashValuesAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HashValuesAsync(key, flags); + } + + public bool HyperLogLogAdd(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogAdd(key, value, flags); + } + + public bool HyperLogLogAdd(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogAdd(key, values, flags); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogAddAsync(key, value, flags); + } + + public Task HyperLogLogAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogAddAsync(key, values, flags); + } + + public long HyperLogLogLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogLength(key, flags); + } + + public long HyperLogLogLength(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogLength(keys, flags); + } + + public Task HyperLogLogLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogLengthAsync(key, flags); + } + + public Task HyperLogLogLengthAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogLengthAsync(keys, flags); + } + + public void HyperLogLogMerge(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + _db.HyperLogLogMerge(destination, first, second, flags); + } + + public void HyperLogLogMerge(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) + { + _db.HyperLogLogMerge(destination, sourceKeys, flags); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogMergeAsync(destination, first, second, flags); + } + + public Task HyperLogLogMergeAsync(RedisKey destination, RedisKey[] sourceKeys, CommandFlags flags = CommandFlags.None) + { + return _db.HyperLogLogMergeAsync(destination, sourceKeys, flags); + } + + public EndPoint? IdentifyEndpoint(RedisKey key = default, CommandFlags flags = CommandFlags.None) + { + return _db.IdentifyEndpoint(key, flags); + } + + public Task IdentifyEndpointAsync(RedisKey key = default, CommandFlags flags = CommandFlags.None) + { + return _db.IdentifyEndpointAsync(key, flags); + } + + public bool IsConnected(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.IsConnected(key, flags); + } + + public bool KeyCopy(RedisKey sourceKey, RedisKey destinationKey, int destinationDatabase = -1, bool replace = false, CommandFlags flags = CommandFlags.None) + { + return _db.KeyCopy(sourceKey, destinationKey, destinationDatabase, replace, flags); + } + + public Task KeyCopyAsync(RedisKey sourceKey, RedisKey destinationKey, int destinationDatabase = -1, bool replace = false, CommandFlags flags = CommandFlags.None) + { + return _db.KeyCopyAsync(sourceKey, destinationKey, destinationDatabase, replace, flags); + } + + public bool KeyDelete(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDelete(key, flags); + } + + public long KeyDelete(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDelete(keys, flags); + } + + public Task KeyDeleteAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDeleteAsync(key, flags); + } + + public Task KeyDeleteAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDeleteAsync(keys, flags); + } + + public byte[]? KeyDump(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDump(key, flags); + } + + public Task KeyDumpAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyDumpAsync(key, flags); + } + + public string? KeyEncoding(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyEncoding(key, flags); + } + + public Task KeyEncodingAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyEncodingAsync(key, flags); + } + + public bool KeyExists(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExists(key, flags); + } + + public long KeyExists(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExists(keys, flags); + } + + public Task KeyExistsAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExistsAsync(key, flags); + } + + public Task KeyExistsAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExistsAsync(keys, flags); + } + + public bool KeyExpire(RedisKey key, TimeSpan? expiry, CommandFlags flags) + { + return _db.KeyExpire(key, expiry, flags); + } + + public bool KeyExpire(RedisKey key, TimeSpan? expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpire(key, expiry, when, flags); + } + + public bool KeyExpire(RedisKey key, DateTime? expiry, CommandFlags flags) + { + return _db.KeyExpire(key, expiry, flags); + } + + public bool KeyExpire(RedisKey key, DateTime? expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpire(key, expiry, when, flags); + } + + public Task KeyExpireAsync(RedisKey key, TimeSpan? expiry, CommandFlags flags) + { + return _db.KeyExpireAsync(key, expiry, flags); + } + + public Task KeyExpireAsync(RedisKey key, TimeSpan? expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpireAsync(key, expiry, when, flags); + } + + public Task KeyExpireAsync(RedisKey key, DateTime? expiry, CommandFlags flags) + { + return _db.KeyExpireAsync(key, expiry, flags); + } + + public Task KeyExpireAsync(RedisKey key, DateTime? expiry, ExpireWhen when = ExpireWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpireAsync(key, expiry, when, flags); + } + + public DateTime? KeyExpireTime(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpireTime(key, flags); + } + + public Task KeyExpireTimeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyExpireTimeAsync(key, flags); + } + + public long? KeyFrequency(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyFrequency(key, flags); + } + + public Task KeyFrequencyAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyFrequencyAsync(key, flags); + } + + public TimeSpan? KeyIdleTime(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyIdleTime(key, flags); + } + + public Task KeyIdleTimeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyIdleTimeAsync(key, flags); + } + + public void KeyMigrate(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) + { + _db.KeyMigrate(key, toServer, toDatabase, timeoutMilliseconds, migrateOptions, flags); + } + + public Task KeyMigrateAsync(RedisKey key, EndPoint toServer, int toDatabase = 0, int timeoutMilliseconds = 0, MigrateOptions migrateOptions = MigrateOptions.None, CommandFlags flags = CommandFlags.None) + { + return _db.KeyMigrateAsync(key, toServer, toDatabase, timeoutMilliseconds, migrateOptions, flags); + } + + public bool KeyMove(RedisKey key, int database, CommandFlags flags = CommandFlags.None) + { + return _db.KeyMove(key, database, flags); + } + + public Task KeyMoveAsync(RedisKey key, int database, CommandFlags flags = CommandFlags.None) + { + return _db.KeyMoveAsync(key, database, flags); + } + + public bool KeyPersist(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyPersist(key, flags); + } + + public Task KeyPersistAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyPersistAsync(key, flags); + } + + public RedisKey KeyRandom(CommandFlags flags = CommandFlags.None) + { + return _db.KeyRandom(flags); + } + + public Task KeyRandomAsync(CommandFlags flags = CommandFlags.None) + { + return _db.KeyRandomAsync(flags); + } + + public long? KeyRefCount(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyRefCount(key, flags); + } + + public Task KeyRefCountAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyRefCountAsync(key, flags); + } + + public bool KeyRename(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyRename(key, newKey, when, flags); + } + + public Task KeyRenameAsync(RedisKey key, RedisKey newKey, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.KeyRenameAsync(key, newKey, when, flags); + } + + public void KeyRestore(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) + { + _db.KeyRestore(key, value, expiry, flags); + } + + public Task KeyRestoreAsync(RedisKey key, byte[] value, TimeSpan? expiry = null, CommandFlags flags = CommandFlags.None) + { + return _db.KeyRestoreAsync(key, value, expiry, flags); + } + + public TimeSpan? KeyTimeToLive(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTimeToLive(key, flags); + } + + public Task KeyTimeToLiveAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTimeToLiveAsync(key, flags); + } + + public bool KeyTouch(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTouch(key, flags); + } + + public long KeyTouch(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTouch(keys, flags); + } + + public Task KeyTouchAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTouchAsync(key, flags); + } + + public Task KeyTouchAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTouchAsync(keys, flags); + } + + public RedisType KeyType(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyType(key, flags); + } + + public Task KeyTypeAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.KeyTypeAsync(key, flags); + } + + public RedisValue ListGetByIndex(RedisKey key, long index, CommandFlags flags = CommandFlags.None) + { + return _db.ListGetByIndex(key, index, flags); + } + + public Task ListGetByIndexAsync(RedisKey key, long index, CommandFlags flags = CommandFlags.None) + { + return _db.ListGetByIndexAsync(key, index, flags); + } + + public long ListInsertAfter(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.ListInsertAfter(key, pivot, value, flags); + } + + public Task ListInsertAfterAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.ListInsertAfterAsync(key, pivot, value, flags); + } + + public long ListInsertBefore(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.ListInsertBefore(key, pivot, value, flags); + } + + public Task ListInsertBeforeAsync(RedisKey key, RedisValue pivot, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.ListInsertBeforeAsync(key, pivot, value, flags); + } + + public RedisValue ListLeftPop(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPop(key, flags); + } + + public RedisValue[] ListLeftPop(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPop(key, count, flags); + } + + public ListPopResult ListLeftPop(RedisKey[] keys, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPop(keys, count, flags); + } + + public Task ListLeftPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPopAsync(key, flags); + } + + public Task ListLeftPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPopAsync(key, count, flags); + } + + public Task ListLeftPopAsync(RedisKey[] keys, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPopAsync(keys, count, flags); + } + + public long ListLeftPush(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPush(key, value, when, flags); + } + + public long ListLeftPush(RedisKey key, RedisValue[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPush(key, values, when, flags); + } + + public long ListLeftPush(RedisKey key, RedisValue[] values, CommandFlags flags) + { + return _db.ListLeftPush(key, values, flags); + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPushAsync(key, value, when, flags); + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListLeftPushAsync(key, values, when, flags); + } + + public Task ListLeftPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags) + { + return _db.ListLeftPushAsync(key, values, flags); + } + + public long ListLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListLength(key, flags); + } + + public Task ListLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListLengthAsync(key, flags); + } + + public RedisValue ListMove(RedisKey sourceKey, RedisKey destinationKey, ListSide sourceSide, ListSide destinationSide, CommandFlags flags = CommandFlags.None) + { + return _db.ListMove(sourceKey, destinationKey, sourceSide, destinationSide, flags); + } + + public Task ListMoveAsync(RedisKey sourceKey, RedisKey destinationKey, ListSide sourceSide, ListSide destinationSide, CommandFlags flags = CommandFlags.None) + { + return _db.ListMoveAsync(sourceKey, destinationKey, sourceSide, destinationSide, flags); + } + + public long ListPosition(RedisKey key, RedisValue element, long rank = 1, long maxLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListPosition(key, element, rank, maxLength, flags); + } + + public Task ListPositionAsync(RedisKey key, RedisValue element, long rank = 1, long maxLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListPositionAsync(key, element, rank, maxLength, flags); + } + + public long[] ListPositions(RedisKey key, RedisValue element, long count, long rank = 1, long maxLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListPositions(key, element, count, rank, maxLength, flags); + } + + public Task ListPositionsAsync(RedisKey key, RedisValue element, long count, long rank = 1, long maxLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListPositionsAsync(key, element, count, rank, maxLength, flags); + } + + public RedisValue[] ListRange(RedisKey key, long start = 0, long stop = -1, CommandFlags flags = CommandFlags.None) + { + return _db.ListRange(key, start, stop, flags); + } + + public Task ListRangeAsync(RedisKey key, long start = 0, long stop = -1, CommandFlags flags = CommandFlags.None) + { + return _db.ListRangeAsync(key, start, stop, flags); + } + + public long ListRemove(RedisKey key, RedisValue value, long count = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListRemove(key, value, count, flags); + } + + public Task ListRemoveAsync(RedisKey key, RedisValue value, long count = 0, CommandFlags flags = CommandFlags.None) + { + return _db.ListRemoveAsync(key, value, count, flags); + } + + public RedisValue ListRightPop(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPop(key, flags); + } + + public RedisValue[] ListRightPop(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPop(key, count, flags); + } + + public ListPopResult ListRightPop(RedisKey[] keys, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPop(keys, count, flags); + } + + public Task ListRightPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPopAsync(key, flags); + } + + public Task ListRightPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPopAsync(key, count, flags); + } + + public Task ListRightPopAsync(RedisKey[] keys, long count, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPopAsync(keys, count, flags); + } + + public RedisValue ListRightPopLeftPush(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPopLeftPush(source, destination, flags); + } + + public Task ListRightPopLeftPushAsync(RedisKey source, RedisKey destination, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPopLeftPushAsync(source, destination, flags); + } + + public long ListRightPush(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPush(key, value, when, flags); + } + + public long ListRightPush(RedisKey key, RedisValue[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPush(key, values, when, flags); + } + + public long ListRightPush(RedisKey key, RedisValue[] values, CommandFlags flags) + { + return _db.ListRightPush(key, values, flags); + } + + public Task ListRightPushAsync(RedisKey key, RedisValue value, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPushAsync(key, value, when, flags); + } + + public Task ListRightPushAsync(RedisKey key, RedisValue[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.ListRightPushAsync(key, values, when, flags); + } + + public Task ListRightPushAsync(RedisKey key, RedisValue[] values, CommandFlags flags) + { + return _db.ListRightPushAsync(key, values, flags); + } + + public void ListSetByIndex(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) + { + _db.ListSetByIndex(key, index, value, flags); + } + + public Task ListSetByIndexAsync(RedisKey key, long index, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.ListSetByIndexAsync(key, index, value, flags); + } + + public void ListTrim(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + _db.ListTrim(key, start, stop, flags); + } + + public Task ListTrimAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + return _db.ListTrimAsync(key, start, stop, flags); + } + + public bool LockExtend(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + return _db.LockExtend(key, value, expiry, flags); + } + + public Task LockExtendAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + return _db.LockExtendAsync(key, value, expiry, flags); + } + + public RedisValue LockQuery(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.LockQuery(key, flags); + } + + public Task LockQueryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.LockQueryAsync(key, flags); + } + + public bool LockRelease(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.LockRelease(key, value, flags); + } + + public Task LockReleaseAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.LockReleaseAsync(key, value, flags); + } + + public bool LockTake(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + return _db.LockTake(key, value, expiry, flags); + } + + public Task LockTakeAsync(RedisKey key, RedisValue value, TimeSpan expiry, CommandFlags flags = CommandFlags.None) + { + return _db.LockTakeAsync(key, value, expiry, flags); + } + + public TimeSpan Ping(CommandFlags flags = CommandFlags.None) + { + return _db.Ping(flags); + } + + public Task PingAsync(CommandFlags flags = CommandFlags.None) + { + return _db.PingAsync(flags); + } + + public long Publish(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) + { + return _db.Publish(channel, message, flags); + } + + public Task PublishAsync(RedisChannel channel, RedisValue message, CommandFlags flags = CommandFlags.None) + { + return _db.PublishAsync(channel, message, flags); + } + + public RedisResult ScriptEvaluate(string script, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluate(script, keys, values, flags); + } + + public RedisResult ScriptEvaluate(byte[] hash, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluate(hash, keys, values, flags); + } + + public RedisResult ScriptEvaluate(LuaScript script, object? parameters = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluate(script, parameters, flags); + } + + public RedisResult ScriptEvaluate(LoadedLuaScript script, object? parameters = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluate(script, parameters, flags); + } + + public Task ScriptEvaluateAsync(string script, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateAsync(script, keys, values, flags); + } + + public Task ScriptEvaluateAsync(byte[] hash, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateAsync(hash, keys, values, flags); + } + + public Task ScriptEvaluateAsync(LuaScript script, object? parameters = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateAsync(script, parameters, flags); + } + + public Task ScriptEvaluateAsync(LoadedLuaScript script, object? parameters = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateAsync(script, parameters, flags); + } + + public RedisResult ScriptEvaluateReadOnly(string script, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateReadOnly(script, keys, values, flags); + } + + public RedisResult ScriptEvaluateReadOnly(byte[] hash, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateReadOnly(hash, keys, values, flags); + } + + public Task ScriptEvaluateReadOnlyAsync(string script, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateReadOnlyAsync(script, keys, values, flags); + } + + public Task ScriptEvaluateReadOnlyAsync(byte[] hash, RedisKey[]? keys = null, RedisValue[]? values = null, CommandFlags flags = CommandFlags.None) + { + return _db.ScriptEvaluateReadOnlyAsync(hash, keys, values, flags); + } + + public bool SetAdd(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetAdd(key, value, flags); + } + + public long SetAdd(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetAdd(key, values, flags); + } + + public Task SetAddAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetAddAsync(key, value, flags); + } + + public Task SetAddAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetAddAsync(key, values, flags); + } + + public RedisValue[] SetCombine(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombine(operation, first, second, flags); + } + + public RedisValue[] SetCombine(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombine(operation, keys, flags); + } + + public long SetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAndStore(operation, destination, first, second, flags); + } + + public long SetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAndStore(operation, destination, keys, flags); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAndStoreAsync(operation, destination, first, second, flags); + } + + public Task SetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAndStoreAsync(operation, destination, keys, flags); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAsync(operation, first, second, flags); + } + + public Task SetCombineAsync(SetOperation operation, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.SetCombineAsync(operation, keys, flags); + } + + public bool SetContains(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetContains(key, value, flags); + } + + public bool[] SetContains(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetContains(key, values, flags); + } + + public Task SetContainsAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetContainsAsync(key, value, flags); + } + + public Task SetContainsAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetContainsAsync(key, values, flags); + } + + public long SetIntersectionLength(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SetIntersectionLength(keys, limit, flags); + } + + public Task SetIntersectionLengthAsync(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SetIntersectionLengthAsync(keys, limit, flags); + } + + public long SetLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetLength(key, flags); + } + + public Task SetLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetLengthAsync(key, flags); + } + + public RedisValue[] SetMembers(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetMembers(key, flags); + } + + public Task SetMembersAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetMembersAsync(key, flags); + } + + public bool SetMove(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetMove(source, destination, value, flags); + } + + public Task SetMoveAsync(RedisKey source, RedisKey destination, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetMoveAsync(source, destination, value, flags); + } + + public RedisValue SetPop(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetPop(key, flags); + } + + public RedisValue[] SetPop(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SetPop(key, count, flags); + } + + public Task SetPopAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetPopAsync(key, flags); + } + + public Task SetPopAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SetPopAsync(key, count, flags); + } + + public RedisValue SetRandomMember(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetRandomMember(key, flags); + } + + public Task SetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SetRandomMemberAsync(key, flags); + } + + public RedisValue[] SetRandomMembers(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SetRandomMembers(key, count, flags); + } + + public Task SetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SetRandomMembersAsync(key, count, flags); + } + + public bool SetRemove(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetRemove(key, value, flags); + } + + public long SetRemove(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetRemove(key, values, flags); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.SetRemoveAsync(key, value, flags); + } + + public Task SetRemoveAsync(RedisKey key, RedisValue[] values, CommandFlags flags = CommandFlags.None) + { + return _db.SetRemoveAsync(key, values, flags); + } + + public IEnumerable SetScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) + { + return _db.SetScan(key, pattern, pageSize, flags); + } + + public IEnumerable SetScan(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SetScan(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public IAsyncEnumerable SetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SetScanAsync(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public RedisValue[] Sort(RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[]? get = null, CommandFlags flags = CommandFlags.None) + { + return _db.Sort(key, skip, take, order, sortType, by, get, flags); + } + + public long SortAndStore(RedisKey destination, RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[]? get = null, CommandFlags flags = CommandFlags.None) + { + return _db.SortAndStore(destination, key, skip, take, order, sortType, by, get, flags); + } + + public Task SortAndStoreAsync(RedisKey destination, RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[]? get = null, CommandFlags flags = CommandFlags.None) + { + return _db.SortAndStoreAsync(destination, key, skip, take, order, sortType, by, get, flags); + } + + public Task SortAsync(RedisKey key, long skip = 0, long take = -1, Order order = Order.Ascending, SortType sortType = SortType.Numeric, RedisValue by = default, RedisValue[]? get = null, CommandFlags flags = CommandFlags.None) + { + return _db.SortAsync(key, skip, take, order, sortType, by, get, flags); + } + + public bool SortedSetAdd(RedisKey key, RedisValue member, double score, CommandFlags flags) + { + return _db.SortedSetAdd(key, member, score, flags); + } + + public bool SortedSetAdd(RedisKey key, RedisValue member, double score, When when, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAdd(key, member, score, when, flags); + } + + public bool SortedSetAdd(RedisKey key, RedisValue member, double score, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAdd(key, member, score, when, flags); + } + + public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, CommandFlags flags) + { + return _db.SortedSetAdd(key, values, flags); + } + + public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, When when, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAdd(key, values, when, flags); + } + + public long SortedSetAdd(RedisKey key, SortedSetEntry[] values, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAdd(key, values, when, flags); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, CommandFlags flags) + { + return _db.SortedSetAddAsync(key, member, score, flags); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, When when, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAddAsync(key, member, score, when, flags); + } + + public Task SortedSetAddAsync(RedisKey key, RedisValue member, double score, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAddAsync(key, member, score, when, flags); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, CommandFlags flags) + { + return _db.SortedSetAddAsync(key, values, flags); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, When when, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAddAsync(key, values, when, flags); + } + + public Task SortedSetAddAsync(RedisKey key, SortedSetEntry[] values, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetAddAsync(key, values, when, flags); + } + + public RedisValue[] SortedSetCombine(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombine(operation, keys, weights, aggregate, flags); + } + + public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineAndStore(operation, destination, first, second, aggregate, flags); + } + + public long SortedSetCombineAndStore(SetOperation operation, RedisKey destination, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineAndStore(operation, destination, keys, weights, aggregate, flags); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey first, RedisKey second, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineAndStoreAsync(operation, destination, first, second, aggregate, flags); + } + + public Task SortedSetCombineAndStoreAsync(SetOperation operation, RedisKey destination, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineAndStoreAsync(operation, destination, keys, weights, aggregate, flags); + } + + public Task SortedSetCombineAsync(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineAsync(operation, keys, weights, aggregate, flags); + } + + public SortedSetEntry[] SortedSetCombineWithScores(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineWithScores(operation, keys, weights, aggregate, flags); + } + + public Task SortedSetCombineWithScoresAsync(SetOperation operation, RedisKey[] keys, double[]? weights = null, Aggregate aggregate = Aggregate.Sum, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetCombineWithScoresAsync(operation, keys, weights, aggregate, flags); + } + + public double SortedSetDecrement(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetDecrement(key, member, value, flags); + } + + public Task SortedSetDecrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetDecrementAsync(key, member, value, flags); + } + + public double SortedSetIncrement(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetIncrement(key, member, value, flags); + } + + public Task SortedSetIncrementAsync(RedisKey key, RedisValue member, double value, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetIncrementAsync(key, member, value, flags); + } + + public long SortedSetIntersectionLength(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetIntersectionLength(keys, limit, flags); + } + + public Task SortedSetIntersectionLengthAsync(RedisKey[] keys, long limit = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetIntersectionLengthAsync(keys, limit, flags); + } + + public long SortedSetLength(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetLength(key, min, max, exclude, flags); + } + + public Task SortedSetLengthAsync(RedisKey key, double min = double.NegativeInfinity, double max = double.PositiveInfinity, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetLengthAsync(key, min, max, exclude, flags); + } + + public long SortedSetLengthByValue(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetLengthByValue(key, min, max, exclude, flags); + } + + public Task SortedSetLengthByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetLengthByValueAsync(key, min, max, exclude, flags); + } + + public SortedSetEntry? SortedSetPop(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPop(key, order, flags); + } + + public SortedSetEntry[] SortedSetPop(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPop(key, count, order, flags); + } + + public SortedSetPopResult SortedSetPop(RedisKey[] keys, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPop(keys, count, order, flags); + } + + public Task SortedSetPopAsync(RedisKey key, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPopAsync(key, order, flags); + } + + public Task SortedSetPopAsync(RedisKey key, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPopAsync(key, count, order, flags); + } + + public Task SortedSetPopAsync(RedisKey[] keys, long count, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetPopAsync(keys, count, order, flags); + } + + public RedisValue SortedSetRandomMember(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMember(key, flags); + } + + public Task SortedSetRandomMemberAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMemberAsync(key, flags); + } + + public RedisValue[] SortedSetRandomMembers(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMembers(key, count, flags); + } + + public Task SortedSetRandomMembersAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMembersAsync(key, count, flags); + } + + public SortedSetEntry[] SortedSetRandomMembersWithScores(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMembersWithScores(key, count, flags); + } + + public Task SortedSetRandomMembersWithScoresAsync(RedisKey key, long count, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRandomMembersWithScoresAsync(key, count, flags); + } + + public long SortedSetRangeAndStore(RedisKey sourceKey, RedisKey destinationKey, RedisValue start, RedisValue stop, SortedSetOrder sortedSetOrder = SortedSetOrder.ByRank, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long? take = null, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeAndStore(sourceKey, destinationKey, start, stop, sortedSetOrder, exclude, order, skip, take, flags); + } + + public Task SortedSetRangeAndStoreAsync(RedisKey sourceKey, RedisKey destinationKey, RedisValue start, RedisValue stop, SortedSetOrder sortedSetOrder = SortedSetOrder.ByRank, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long? take = null, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeAndStoreAsync(sourceKey, destinationKey, start, stop, sortedSetOrder, exclude, order, skip, take, flags); + } + + public RedisValue[] SortedSetRangeByRank(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByRank(key, start, stop, order, flags); + } + + public Task SortedSetRangeByRankAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByRankAsync(key, start, stop, order, flags); + } + + public SortedSetEntry[] SortedSetRangeByRankWithScores(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByRankWithScores(key, start, stop, order, flags); + } + + public Task SortedSetRangeByRankWithScoresAsync(RedisKey key, long start = 0, long stop = -1, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByRankWithScoresAsync(key, start, stop, order, flags); + } + + public RedisValue[] SortedSetRangeByScore(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByScore(key, start, stop, exclude, order, skip, take, flags); + } + + public Task SortedSetRangeByScoreAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByScoreAsync(key, start, stop, exclude, order, skip, take, flags); + } + + public SortedSetEntry[] SortedSetRangeByScoreWithScores(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByScoreWithScores(key, start, stop, exclude, order, skip, take, flags); + } + + public Task SortedSetRangeByScoreWithScoresAsync(RedisKey key, double start = double.NegativeInfinity, double stop = double.PositiveInfinity, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByScoreWithScoresAsync(key, start, stop, exclude, order, skip, take, flags); + } + + public RedisValue[] SortedSetRangeByValue(RedisKey key, RedisValue min, RedisValue max, Exclude exclude, long skip, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByValue(key, min, max, exclude, skip, take, flags); + } + + public RedisValue[] SortedSetRangeByValue(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByValue(key, min, max, exclude, order, skip, take, flags); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude, long skip, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByValueAsync(key, min, max, exclude, skip, take, flags); + } + + public Task SortedSetRangeByValueAsync(RedisKey key, RedisValue min = default, RedisValue max = default, Exclude exclude = Exclude.None, Order order = Order.Ascending, long skip = 0, long take = -1, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRangeByValueAsync(key, min, max, exclude, order, skip, take, flags); + } + + public long? SortedSetRank(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRank(key, member, order, flags); + } + + public Task SortedSetRankAsync(RedisKey key, RedisValue member, Order order = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRankAsync(key, member, order, flags); + } + + public bool SortedSetRemove(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemove(key, member, flags); + } + + public long SortedSetRemove(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemove(key, members, flags); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveAsync(key, member, flags); + } + + public Task SortedSetRemoveAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveAsync(key, members, flags); + } + + public long SortedSetRemoveRangeByRank(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByRank(key, start, stop, flags); + } + + public Task SortedSetRemoveRangeByRankAsync(RedisKey key, long start, long stop, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByRankAsync(key, start, stop, flags); + } + + public long SortedSetRemoveRangeByScore(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByScore(key, start, stop, exclude, flags); + } + + public Task SortedSetRemoveRangeByScoreAsync(RedisKey key, double start, double stop, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByScoreAsync(key, start, stop, exclude, flags); + } + + public long SortedSetRemoveRangeByValue(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByValue(key, min, max, exclude, flags); + } + + public Task SortedSetRemoveRangeByValueAsync(RedisKey key, RedisValue min, RedisValue max, Exclude exclude = Exclude.None, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetRemoveRangeByValueAsync(key, min, max, exclude, flags); + } + + public IEnumerable SortedSetScan(RedisKey key, RedisValue pattern, int pageSize, CommandFlags flags) + { + return _db.SortedSetScan(key, pattern, pageSize, flags); + } + + public IEnumerable SortedSetScan(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScan(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public IAsyncEnumerable SortedSetScanAsync(RedisKey key, RedisValue pattern = default, int pageSize = 250, long cursor = 0, int pageOffset = 0, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScanAsync(key, pattern, pageSize, cursor, pageOffset, flags); + } + + public double? SortedSetScore(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScore(key, member, flags); + } + + public Task SortedSetScoreAsync(RedisKey key, RedisValue member, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScoreAsync(key, member, flags); + } + + public double?[] SortedSetScores(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScores(key, members, flags); + } + + public Task SortedSetScoresAsync(RedisKey key, RedisValue[] members, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetScoresAsync(key, members, flags); + } + + public bool SortedSetUpdate(RedisKey key, RedisValue member, double score, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetUpdate(key, member, score, when, flags); + } + + public long SortedSetUpdate(RedisKey key, SortedSetEntry[] values, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetUpdate(key, values, when, flags); + } + + public Task SortedSetUpdateAsync(RedisKey key, RedisValue member, double score, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetUpdateAsync(key, member, score, when, flags); + } + + public Task SortedSetUpdateAsync(RedisKey key, SortedSetEntry[] values, SortedSetWhen when = SortedSetWhen.Always, CommandFlags flags = CommandFlags.None) + { + return _db.SortedSetUpdateAsync(key, values, when, flags); + } + + public long StreamAcknowledge(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAcknowledge(key, groupName, messageId, flags); + } + + public long StreamAcknowledge(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAcknowledge(key, groupName, messageIds, flags); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue messageId, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAcknowledgeAsync(key, groupName, messageId, flags); + } + + public Task StreamAcknowledgeAsync(RedisKey key, RedisValue groupName, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAcknowledgeAsync(key, groupName, messageIds, flags); + } + + public RedisValue StreamAdd(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAdd(key, streamField, streamValue, messageId, maxLength, useApproximateMaxLength, flags); + } + + public RedisValue StreamAdd(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAdd(key, streamPairs, messageId, maxLength, useApproximateMaxLength, flags); + } + + public Task StreamAddAsync(RedisKey key, RedisValue streamField, RedisValue streamValue, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAddAsync(key, streamField, streamValue, messageId, maxLength, useApproximateMaxLength, flags); + } + + public Task StreamAddAsync(RedisKey key, NameValueEntry[] streamPairs, RedisValue? messageId = null, int? maxLength = null, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAddAsync(key, streamPairs, messageId, maxLength, useApproximateMaxLength, flags); + } + + public StreamAutoClaimResult StreamAutoClaim(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue startAtId, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAutoClaim(key, consumerGroup, claimingConsumer, minIdleTimeInMs, startAtId, count, flags); + } + + public Task StreamAutoClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue startAtId, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAutoClaimAsync(key, consumerGroup, claimingConsumer, minIdleTimeInMs, startAtId, count, flags); + } + + public StreamAutoClaimIdsOnlyResult StreamAutoClaimIdsOnly(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue startAtId, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAutoClaimIdsOnly(key, consumerGroup, claimingConsumer, minIdleTimeInMs, startAtId, count, flags); + } + + public Task StreamAutoClaimIdsOnlyAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue startAtId, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamAutoClaimIdsOnlyAsync(key, consumerGroup, claimingConsumer, minIdleTimeInMs, startAtId, count, flags); + } + + public StreamEntry[] StreamClaim(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamClaim(key, consumerGroup, claimingConsumer, minIdleTimeInMs, messageIds, flags); + } + + public Task StreamClaimAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamClaimAsync(key, consumerGroup, claimingConsumer, minIdleTimeInMs, messageIds, flags); + } + + public RedisValue[] StreamClaimIdsOnly(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamClaimIdsOnly(key, consumerGroup, claimingConsumer, minIdleTimeInMs, messageIds, flags); + } + + public Task StreamClaimIdsOnlyAsync(RedisKey key, RedisValue consumerGroup, RedisValue claimingConsumer, long minIdleTimeInMs, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamClaimIdsOnlyAsync(key, consumerGroup, claimingConsumer, minIdleTimeInMs, messageIds, flags); + } + + public bool StreamConsumerGroupSetPosition(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + return _db.StreamConsumerGroupSetPosition(key, groupName, position, flags); + } + + public Task StreamConsumerGroupSetPositionAsync(RedisKey key, RedisValue groupName, RedisValue position, CommandFlags flags = CommandFlags.None) + { + return _db.StreamConsumerGroupSetPositionAsync(key, groupName, position, flags); + } + + public StreamConsumerInfo[] StreamConsumerInfo(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamConsumerInfo(key, groupName, flags); + } + + public Task StreamConsumerInfoAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamConsumerInfoAsync(key, groupName, flags); + } + + public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + return _db.StreamCreateConsumerGroup(key, groupName, position, flags); + } + + public bool StreamCreateConsumerGroup(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + return _db.StreamCreateConsumerGroup(key, groupName, position, createStream, flags); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position, CommandFlags flags) + { + return _db.StreamCreateConsumerGroupAsync(key, groupName, position, flags); + } + + public Task StreamCreateConsumerGroupAsync(RedisKey key, RedisValue groupName, RedisValue? position = null, bool createStream = true, CommandFlags flags = CommandFlags.None) + { + return _db.StreamCreateConsumerGroupAsync(key, groupName, position, createStream, flags); + } + + public long StreamDelete(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDelete(key, messageIds, flags); + } + + public Task StreamDeleteAsync(RedisKey key, RedisValue[] messageIds, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDeleteAsync(key, messageIds, flags); + } + + public long StreamDeleteConsumer(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDeleteConsumer(key, groupName, consumerName, flags); + } + + public Task StreamDeleteConsumerAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDeleteConsumerAsync(key, groupName, consumerName, flags); + } + + public bool StreamDeleteConsumerGroup(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDeleteConsumerGroup(key, groupName, flags); + } + + public Task StreamDeleteConsumerGroupAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamDeleteConsumerGroupAsync(key, groupName, flags); + } + + public StreamGroupInfo[] StreamGroupInfo(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamGroupInfo(key, flags); + } + + public Task StreamGroupInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamGroupInfoAsync(key, flags); + } + + public StreamInfo StreamInfo(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamInfo(key, flags); + } + + public Task StreamInfoAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamInfoAsync(key, flags); + } + + public long StreamLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamLength(key, flags); + } + + public Task StreamLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StreamLengthAsync(key, flags); + } + + public StreamPendingInfo StreamPending(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamPending(key, groupName, flags); + } + + public Task StreamPendingAsync(RedisKey key, RedisValue groupName, CommandFlags flags = CommandFlags.None) + { + return _db.StreamPendingAsync(key, groupName, flags); + } + + public StreamPendingMessageInfo[] StreamPendingMessages(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamPendingMessages(key, groupName, count, consumerName, minId, maxId, flags); + } + + public Task StreamPendingMessagesAsync(RedisKey key, RedisValue groupName, int count, RedisValue consumerName, RedisValue? minId = null, RedisValue? maxId = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamPendingMessagesAsync(key, groupName, count, consumerName, minId, maxId, flags); + } + + public StreamEntry[] StreamRange(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.StreamRange(key, minId, maxId, count, messageOrder, flags); + } + + public Task StreamRangeAsync(RedisKey key, RedisValue? minId = null, RedisValue? maxId = null, int? count = null, Order messageOrder = Order.Ascending, CommandFlags flags = CommandFlags.None) + { + return _db.StreamRangeAsync(key, minId, maxId, count, messageOrder, flags); + } + + public StreamEntry[] StreamRead(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamRead(key, position, count, flags); + } + + public RedisStream[] StreamRead(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamRead(streamPositions, countPerStream, flags); + } + + public Task StreamReadAsync(RedisKey key, RedisValue position, int? count = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadAsync(key, position, count, flags); + } + + public Task StreamReadAsync(StreamPosition[] streamPositions, int? countPerStream = null, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadAsync(streamPositions, countPerStream, flags); + } + + public StreamEntry[] StreamReadGroup(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + return _db.StreamReadGroup(key, groupName, consumerName, position, count, flags); + } + + public StreamEntry[] StreamReadGroup(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadGroup(key, groupName, consumerName, position, count, noAck, flags); + } + + public RedisStream[] StreamReadGroup(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + return _db.StreamReadGroup(streamPositions, groupName, consumerName, countPerStream, flags); + } + + public RedisStream[] StreamReadGroup(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadGroup(streamPositions, groupName, consumerName, countPerStream, noAck, flags); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position, int? count, CommandFlags flags) + { + return _db.StreamReadGroupAsync(key, groupName, consumerName, position, count, flags); + } + + public Task StreamReadGroupAsync(RedisKey key, RedisValue groupName, RedisValue consumerName, RedisValue? position = null, int? count = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadGroupAsync(key, groupName, consumerName, position, count, noAck, flags); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream, CommandFlags flags) + { + return _db.StreamReadGroupAsync(streamPositions, groupName, consumerName, countPerStream, flags); + } + + public Task StreamReadGroupAsync(StreamPosition[] streamPositions, RedisValue groupName, RedisValue consumerName, int? countPerStream = null, bool noAck = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamReadGroupAsync(streamPositions, groupName, consumerName, countPerStream, noAck, flags); + } + + public long StreamTrim(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamTrim(key, maxLength, useApproximateMaxLength, flags); + } + + public Task StreamTrimAsync(RedisKey key, int maxLength, bool useApproximateMaxLength = false, CommandFlags flags = CommandFlags.None) + { + return _db.StreamTrimAsync(key, maxLength, useApproximateMaxLength, flags); + } + + public long StringAppend(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringAppend(key, value, flags); + } + + public Task StringAppendAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringAppendAsync(key, value, flags); + } + + public long StringBitCount(RedisKey key, long start, long end, CommandFlags flags) + { + return _db.StringBitCount(key, start, end, flags); + } + + public long StringBitCount(RedisKey key, long start = 0, long end = -1, StringIndexType indexType = StringIndexType.Byte, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitCount(key, start, end, indexType, flags); + } + + public Task StringBitCountAsync(RedisKey key, long start, long end, CommandFlags flags) + { + return _db.StringBitCountAsync(key, start, end, flags); + } + + public Task StringBitCountAsync(RedisKey key, long start = 0, long end = -1, StringIndexType indexType = StringIndexType.Byte, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitCountAsync(key, start, end, indexType, flags); + } + + public long StringBitOperation(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitOperation(operation, destination, first, second, flags); + } + + public long StringBitOperation(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitOperation(operation, destination, keys, flags); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey first, RedisKey second = default, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitOperationAsync(operation, destination, first, second, flags); + } + + public Task StringBitOperationAsync(Bitwise operation, RedisKey destination, RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitOperationAsync(operation, destination, keys, flags); + } + + public long StringBitPosition(RedisKey key, bool bit, long start, long end, CommandFlags flags) + { + return _db.StringBitPosition(key, bit, start, end, flags); + } + + public long StringBitPosition(RedisKey key, bool bit, long start = 0, long end = -1, StringIndexType indexType = StringIndexType.Byte, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitPosition(key, bit, start, end, indexType, flags); + } + + public Task StringBitPositionAsync(RedisKey key, bool bit, long start, long end, CommandFlags flags) + { + return _db.StringBitPositionAsync(key, bit, start, end, flags); + } + + public Task StringBitPositionAsync(RedisKey key, bool bit, long start = 0, long end = -1, StringIndexType indexType = StringIndexType.Byte, CommandFlags flags = CommandFlags.None) + { + return _db.StringBitPositionAsync(key, bit, start, end, indexType, flags); + } + + public long StringDecrement(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.StringDecrement(key, value, flags); + } + + public double StringDecrement(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + return _db.StringDecrement(key, value, flags); + } + + public Task StringDecrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.StringDecrementAsync(key, value, flags); + } + + public Task StringDecrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + return _db.StringDecrementAsync(key, value, flags); + } + + public RedisValue StringGet(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGet(key, flags); + } + + public RedisValue[] StringGet(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.StringGet(keys, flags); + } + + public Task StringGetAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetAsync(key, flags); + } + + public Task StringGetAsync(RedisKey[] keys, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetAsync(keys, flags); + } + + public bool StringGetBit(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetBit(key, offset, flags); + } + + public Task StringGetBitAsync(RedisKey key, long offset, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetBitAsync(key, offset, flags); + } + + public RedisValue StringGetDelete(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetDelete(key, flags); + } + + public Task StringGetDeleteAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetDeleteAsync(key, flags); + } + + public Lease? StringGetLease(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetLease(key, flags); + } + + public Task?> StringGetLeaseAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetLeaseAsync(key, flags); + } + + public RedisValue StringGetRange(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetRange(key, start, end, flags); + } + + public Task StringGetRangeAsync(RedisKey key, long start, long end, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetRangeAsync(key, start, end, flags); + } + + public RedisValue StringGetSet(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSet(key, value, flags); + } + + public Task StringGetSetAsync(RedisKey key, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSetAsync(key, value, flags); + } + + public RedisValue StringGetSetExpiry(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSetExpiry(key, expiry, flags); + } + + public RedisValue StringGetSetExpiry(RedisKey key, DateTime expiry, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSetExpiry(key, expiry, flags); + } + + public Task StringGetSetExpiryAsync(RedisKey key, TimeSpan? expiry, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSetExpiryAsync(key, expiry, flags); + } + + public Task StringGetSetExpiryAsync(RedisKey key, DateTime expiry, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetSetExpiryAsync(key, expiry, flags); + } + + public RedisValueWithExpiry StringGetWithExpiry(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetWithExpiry(key, flags); + } + + public Task StringGetWithExpiryAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringGetWithExpiryAsync(key, flags); + } + + public long StringIncrement(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.StringIncrement(key, value, flags); + } + + public double StringIncrement(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + return _db.StringIncrement(key, value, flags); + } + + public Task StringIncrementAsync(RedisKey key, long value = 1, CommandFlags flags = CommandFlags.None) + { + return _db.StringIncrementAsync(key, value, flags); + } + + public Task StringIncrementAsync(RedisKey key, double value, CommandFlags flags = CommandFlags.None) + { + return _db.StringIncrementAsync(key, value, flags); + } + + public long StringLength(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringLength(key, flags); + } + + public Task StringLengthAsync(RedisKey key, CommandFlags flags = CommandFlags.None) + { + return _db.StringLengthAsync(key, flags); + } + + public string? StringLongestCommonSubsequence(RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequence(first, second, flags); + } + + public Task StringLongestCommonSubsequenceAsync(RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequenceAsync(first, second, flags); + } + + public long StringLongestCommonSubsequenceLength(RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequenceLength(first, second, flags); + } + + public Task StringLongestCommonSubsequenceLengthAsync(RedisKey first, RedisKey second, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequenceLengthAsync(first, second, flags); + } + + public LCSMatchResult StringLongestCommonSubsequenceWithMatches(RedisKey first, RedisKey second, long minLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequenceWithMatches(first, second, minLength, flags); + } + + public Task StringLongestCommonSubsequenceWithMatchesAsync(RedisKey first, RedisKey second, long minLength = 0, CommandFlags flags = CommandFlags.None) + { + return _db.StringLongestCommonSubsequenceWithMatchesAsync(first, second, minLength, flags); + } + + public bool StringSet(RedisKey key, RedisValue value, TimeSpan? expiry, When when) + { + return _db.StringSet(key, value, expiry, when); + } + + public bool StringSet(RedisKey key, RedisValue value, TimeSpan? expiry, When when, CommandFlags flags) + { + return _db.StringSet(key, value, expiry, when, flags); + } + + public bool StringSet(RedisKey key, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSet(key, value, expiry, keepTtl, when, flags); + } + + public bool StringSet(KeyValuePair[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSet(values, when, flags); + } + + public RedisValue StringSetAndGet(RedisKey key, RedisValue value, TimeSpan? expiry, When when, CommandFlags flags) + { + return _db.StringSetAndGet(key, value, expiry, when, flags); + } + + public RedisValue StringSetAndGet(RedisKey key, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetAndGet(key, value, expiry, keepTtl, when, flags); + } + + public Task StringSetAndGetAsync(RedisKey key, RedisValue value, TimeSpan? expiry, When when, CommandFlags flags) + { + return _db.StringSetAndGetAsync(key, value, expiry, when, flags); + } + + public Task StringSetAndGetAsync(RedisKey key, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetAndGetAsync(key, value, expiry, keepTtl, when, flags); + } + + public Task StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry, When when) + { + return _db.StringSetAsync(key, value, expiry, when); + } + + public Task StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry, When when, CommandFlags flags) + { + return _db.StringSetAsync(key, value, expiry, when, flags); + } + + public Task StringSetAsync(RedisKey key, RedisValue value, TimeSpan? expiry = null, bool keepTtl = false, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetAsync(key, value, expiry, keepTtl, when, flags); + } + + public Task StringSetAsync(KeyValuePair[] values, When when = When.Always, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetAsync(values, when, flags); + } + + public bool StringSetBit(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetBit(key, offset, bit, flags); + } + + public Task StringSetBitAsync(RedisKey key, long offset, bool bit, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetBitAsync(key, offset, bit, flags); + } + + public RedisValue StringSetRange(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetRange(key, offset, value, flags); + } + + public Task StringSetRangeAsync(RedisKey key, long offset, RedisValue value, CommandFlags flags = CommandFlags.None) + { + return _db.StringSetRangeAsync(key, offset, value, flags); + } + + public bool TryWait(Task task) + { + return _db.TryWait(task); + } + + public void Wait(Task task) + { + _db.Wait(task); + } + + public T Wait(Task task) + { + return _db.Wait(task); + } + + public void WaitAll(params Task[] tasks) + { + _db.WaitAll(tasks); + } + } +} \ No newline at end of file diff --git a/src/NRedisStack/IRedisClient.cs b/src/NRedisStack/IRedisClient.cs new file mode 100644 index 00000000..065f1c75 --- /dev/null +++ b/src/NRedisStack/IRedisClient.cs @@ -0,0 +1,28 @@ +using StackExchange.Redis; + +namespace NRedisStack; + +/// +/// This class is EXPERIMENTAL!! and may change or removed in future releases. +/// Represents a Redis client that can connect to a Redis server +/// providing access to instances as well as the underlying multiplexer. +/// +public interface IRedisClient +{ + /// + /// Gets a database instance. + /// + /// The ID to get a database for. + /// The async state to pass into the resulting . + /// + public IRedisDatabase GetDatabase(int db = -1, object? asyncState = null); + + /// + /// Gets the underlying instance. + /// + /// + public IConnectionMultiplexer GetMultiplexer(); +} + + + diff --git a/src/NRedisStack/IRedisDatabase.cs b/src/NRedisStack/IRedisDatabase.cs new file mode 100644 index 00000000..187ff6d5 --- /dev/null +++ b/src/NRedisStack/IRedisDatabase.cs @@ -0,0 +1,60 @@ +using StackExchange.Redis; + +namespace NRedisStack; + +/// +/// This class is EXPERIMENTAL!! and may change or removed in future releases. +/// Interface that provides access to Redis commands +/// including Search, JSON, TimeSeries, Bloom and more.. +/// +public interface IRedisDatabase : IDatabase +{ + /// + /// Gets a command set for interacting with the RedisBloom Bloom Filter module. + /// + /// Command set for Bloom Filter operations. + public BloomCommands BF(); + + /// + /// Gets a command set for interacting with the RedisBloom Count-Min Sketch module. + /// + /// Command set for Count-Min Sketch operations. + public CmsCommands CMS(); + + /// + /// Gets a command set for interacting with the RedisBloom Cuckoo Filter module. + /// + /// Command set for Cuckoo Filter operations. + public CuckooCommands CF(); + + /// + /// Gets a command set for interacting with the RedisJSON module. + /// + /// Command set for JSON operations. + public JsonCommands JSON(); + + /// + /// Gets a command set for interacting with the RediSearch module. + /// + /// The search dialect version to use. Defaults to 2. + /// Command set for search operations. + public SearchCommands FT(int? searchDialect = 2); + + /// + /// Gets a command set for interacting with the Redis t-digest module. + /// + /// Command set for t-digest operations. + public TdigestCommands TDIGEST(); + + /// + /// Gets a command set for interacting with the RedisTimeSeries module. + /// + /// Command set for time series operations. + public TimeSeriesCommands TS(); + + /// + /// Gets a command set for interacting with the RedisBloom TopK module. + /// + /// Command set for TopK operations. + public TopKCommands TOPK(); +} \ No newline at end of file diff --git a/src/NRedisStack/RedisClient.cs b/src/NRedisStack/RedisClient.cs new file mode 100644 index 00000000..50d6e726 --- /dev/null +++ b/src/NRedisStack/RedisClient.cs @@ -0,0 +1,127 @@ +using StackExchange.Redis; + +namespace NRedisStack; + +/// +/// This class is EXPERIMENTAL!! and may change or removed in future releases. +/// Represents a Redis client that can connect to a Redis server +/// providing access to instances as well as the underlying multiplexer. +/// +public class RedisClient : IRedisClient +{ + private IConnectionMultiplexer _multiplexer; + + private RedisClient(IConnectionMultiplexer multiplexer) + { + _multiplexer = multiplexer; + } + + /// + /// Creates a new instance. + /// + /// The string configuration to use for this client. + /// The to log to. + public static async Task ConnectAsync(string configuration, TextWriter? log = null) => + await ConnectAsync(ConfigurationOptions.Parse(configuration), log); + + /// + /// Creates a new instance. + /// + /// The string configuration to use for this client. + /// Action to further modify the parsed configuration options. + /// The to log to. + public static async Task ConnectAsync(string configuration, Action configure, TextWriter? log = null) + { + Action config = (ConfigurationOptions config) => + { + configure?.Invoke(config); + SetNames(config); + }; + return new RedisClient(await ConnectionMultiplexer.ConnectAsync(configuration, configure, log)); + } + + /// + /// Creates a new instance. + /// + /// The configuration options to use for this client. + /// The to log to. + /// Note: For Sentinel, do not specify a - this is handled automatically. + public static async Task ConnectAsync(ConfigurationOptions configuration, TextWriter? log = null) + { + SetNames(configuration); + return new RedisClient(await ConnectionMultiplexer.ConnectAsync(configuration, log)); + } + + /// + /// Creates a new instance. + /// + /// The string configuration to use for this client. See the StackExchange.Redis configuration documentation(https://stackexchange.github.io/StackExchange.Redis/Configuration) for detailed information. + /// The to log to. + public static IRedisClient Connect(string configuration, TextWriter? log = null) => + Connect(ConfigurationOptions.Parse(configuration), log); + + /// + /// Creates a new instance. + /// + /// The string configuration to use for this client. + /// Action to further modify the parsed configuration options. + /// The to log to. + public static IRedisClient Connect(string configuration, Action configure, TextWriter? log = null) + { + Action config = (ConfigurationOptions config) => + { + configure?.Invoke(config); + SetNames(config); + }; + return new RedisClient(ConnectionMultiplexer.Connect(configuration, configure, log)); + } + + /// + /// Creates a new instance. + /// + /// The configuration options to use for this client. + /// The to log to. + /// Note: For Sentinel, do not specify a - this is handled automatically. + public static IRedisClient Connect(ConfigurationOptions configuration, TextWriter? log = null) + { + SetNames(configuration); + return new RedisClient(ConnectionMultiplexer.Connect(configuration, log)); + } + + /// + /// Gets a database instance. + /// + /// The ID to get a database for. + /// The async state to pass into the resulting . + /// + public IRedisDatabase GetDatabase(int db = -1, object? asyncState = null) + { + var idatabase = _multiplexer.GetDatabase(db, asyncState); + return new RedisDatabase(idatabase); + } + + /// + /// Gets the underlying instance. + /// + /// + public IConnectionMultiplexer GetMultiplexer() + { + return _multiplexer; + } + + private static void SetNames(ConfigurationOptions config) + { + if (config.LibraryName == null) + { + config.LibraryName = Auxiliary.GetNRedisStackLibName(); + } + + if (config.ClientName == null) + { + config.ClientName = (Environment.MachineName ?? Environment.GetEnvironmentVariable("ComputerName") ?? "Unknown") + $"-NRedisStack(.NET_v{Environment.Version})"; + } + } +} + + + diff --git a/src/NRedisStack/RedisDatabase.cs b/src/NRedisStack/RedisDatabase.cs new file mode 100644 index 00000000..0d2a6c97 --- /dev/null +++ b/src/NRedisStack/RedisDatabase.cs @@ -0,0 +1,25 @@ +using NRedisStack.RedisStackCommands; +using StackExchange.Redis; + +namespace NRedisStack; + +internal class RedisDatabase : DatabaseWrapper, IRedisDatabase +{ + public RedisDatabase(IDatabase db) : base(db) { } + + public BloomCommands BF() => new BloomCommands(_db); + + public CuckooCommands CF() => new CuckooCommands(_db); + + public CmsCommands CMS() => new CmsCommands(_db); + + public TopKCommands TOPK() => new TopKCommands(_db); + + public TdigestCommands TDIGEST() => new TdigestCommands(_db); + + public SearchCommands FT(int? searchDialect = 2) => new SearchCommands(_db, searchDialect); + + public JsonCommands JSON() => new JsonCommands(_db); + + public TimeSeriesCommands TS() => new TimeSeriesCommands(_db); +} \ No newline at end of file diff --git a/tests/NRedisStack.Tests/ClientInfoTests.cs b/tests/NRedisStack.Tests/ClientInfoTests.cs new file mode 100644 index 00000000..a68fb8de --- /dev/null +++ b/tests/NRedisStack.Tests/ClientInfoTests.cs @@ -0,0 +1,139 @@ +using Xunit; +using StackExchange.Redis; +using NRedisStack.RedisStackCommands; +using System.Text.Json; +using NRedisStack.Search; +using System.Diagnostics; +using Microsoft.Identity.Client; +using System.Net; + +namespace NRedisStack.Tests; + +public class ClientInfoTests : AbstractNRedisStackTest, IDisposable +{ + public ClientInfoTests(EndpointsFixture endpointsFixture) : base(endpointsFixture) + { + } + + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] + [InlineData] // No parameters passed, but still uses Theory + public void TestMultiplexerInfoOnReconnect() + { + bool reconnected = false; + bool hang = false; + var db = GetCleanDatabase(); + db.Multiplexer.ConnectionRestored += (sender, e) => reconnected = true; + Assert.Contains("lib-name=SE.Redis", db.Execute("CLIENT", "INFO").ToString()); + Auxiliary.ResetInfoDefaults(); + db.FT()._List(); + Assert.Contains("lib-name=NRedisStack", db.Execute("CLIENT", "INFO").ToString()); + + Stopwatch sw = new Stopwatch(); + sw.Start(); + while ((!reconnected) && !hang) + { + try + { + RedisResult clientId = db.Execute("CLIENT", "ID"); + db.ExecuteAsync("CLIENT", "KILL", "ID", ((RedisValue)clientId), "SKIPME", "NO"); + } + catch (Exception) { } + hang = sw.Elapsed.TotalMilliseconds > 3000.0D; + } + Assert.True(reconnected, "Client was not reconnected"); + Assert.False(hang, "It took more than 3 seconds, likely it hanged"); + string clientInfo = null; + while (sw.Elapsed.Milliseconds < 4000 && clientInfo == null) + { + try { clientInfo = db.Execute("CLIENT", "INFO").ToString(); } + catch (Exception) { } + } + Assert.Contains("lib-name=SE.Redis", clientInfo); + } + + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] + [InlineData] // No parameters passed, but still uses Theory + public void TestRedisClientInfoOnReconnect() + { + bool reconnected = false; + bool hang = false; + IRedisClient rc = RedisClient.Connect(GetEndpoint()); + IRedisDatabase db = rc.GetDatabase(); + db.Multiplexer.ConnectionRestored += (sender, e) => reconnected = true; + + Stopwatch sw = new Stopwatch(); + sw.Start(); + while ((!reconnected) && !hang) + { + try + { + RedisResult clientId = db.Execute("CLIENT", "ID"); + db.ExecuteAsync("CLIENT", "KILL", "ID", ((RedisValue)clientId), "SKIPME", "NO"); + } + catch (Exception) { } + hang = sw.Elapsed.TotalMilliseconds > 3000.0D; + } + + Assert.True(reconnected, "Client was not reconnected"); + Assert.False(hang, "It took more than 3 seconds, likely it hanged"); + string clientInfo = null; + while (sw.Elapsed.Milliseconds < 4000 && clientInfo == null) + { + try { clientInfo = db.Execute("CLIENT", "INFO").ToString(); } + catch (Exception) { } + } + Assert.Contains("lib-name=NRedisStack", clientInfo); + } + + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] + [InlineData] // No parameters passed, but still uses Theory + public void TestConnectionMultiplexerConnect() + { + IDatabase db = ConnectionMultiplexer.Connect(GetEndpoint()).GetDatabase(); + Auxiliary.ResetInfoDefaults(); + db.StringSetAsync("key1", "something"); + var _ = db.FT()._List(); + Assert.Contains("lib-name=NRedisStack", db.Execute("CLIENT", "INFO").ToString()); + } + + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] + [InlineData] // No parameters passed, but still uses Theory + public void TestRedisClientConnect() + { + IRedisClient rc = RedisClient.Connect(GetEndpoint()); + IRedisDatabase db = rc.GetDatabase(); + db.StringSetAsync("key1", "something"); + Assert.Contains("lib-name=NRedisStack", db.Execute("CLIENT", "INFO").ToString()); + } + + [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] + [InlineData] // No parameters passed, but still uses Theory + public void TestRedisClientConnectWithConfigOptions() + { + ConfigurationOptions config = new ConfigurationOptions + { + EndPoints = { GetEndpoint() }, + LibraryName = "TestLib", + }; + + IRedisClient rc = RedisClient.Connect(config); + IRedisDatabase db = rc.GetDatabase(); + db.StringSetAsync("key1", "something"); + Assert.Contains("lib-name=TestLib", db.Execute("CLIENT", "INFO").ToString()); + } + + private string GetEndpoint() + { + var ep = GetCleanDatabase().Multiplexer.GetEndPoints()[0]; + String endpoint = null; + if (ep is IPEndPoint iep) + { + endpoint = $"{iep.Address}:{iep.Port}"; + } + else if (ep is DnsEndPoint dep) + { + endpoint = $"{dep.Host}:{dep.Port}"; + } + return endpoint; + } +} \ No newline at end of file diff --git a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs index 61b8ec41..0e562fd7 100644 --- a/tests/NRedisStack.Tests/Core Commands/CoreTests.cs +++ b/tests/NRedisStack.Tests/Core Commands/CoreTests.cs @@ -51,7 +51,7 @@ public void TestSetInfoDefaultValue(string endpointId) db.Execute(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = db.Execute("CLIENT", "INFO").ToString(); - Assert.Contains($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}", info); + Assert.Contains($"lib-name=NRedisStack-{GetNRedisStackVersion()} lib-ver={GetNRedisStackVersion()}", info); } [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")] @@ -64,7 +64,7 @@ public async Task TestSetInfoDefaultValueAsync(string endpointId) await db.ExecuteAsync(new SerializedCommand("PING")); // only the extension method of Execute (which is used for all the commands of Redis Stack) will set the library name and version. var info = (await db.ExecuteAsync("CLIENT", "INFO")).ToString(); - Assert.Contains($"lib-name=NRedisStack(.NET_v{Environment.Version}) lib-ver={GetNRedisStackVersion()}", info); + Assert.Contains($"lib-name=NRedisStack-{GetNRedisStackVersion()} lib-ver={GetNRedisStackVersion()}", info); } [SkipIfRedis(Is.Enterprise, Comparison.LessThan, "7.1.242")]