@@ -5,192 +5,189 @@ namespace RESPite.StackExchange.Redis;
55
66internal partial class RespContextDatabase
77{
8- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
9- private KeyCommands Keys ( CommandFlags flags ) => Context ( flags ) . Keys ( ) ;
10-
118 public bool KeyCopy (
129 RedisKey sourceKey ,
1310 RedisKey destinationKey ,
1411 int destinationDatabase = - 1 ,
1512 bool replace = false ,
1613 CommandFlags flags = CommandFlags . None )
17- => Keys ( flags ) . Copy ( sourceKey , destinationKey , destinationDatabase , replace ) . Wait ( SyncTimeout ) ;
14+ => Context ( flags ) . Keys ( ) . Copy ( sourceKey , destinationKey , destinationDatabase , replace ) . Wait ( SyncTimeout ) ;
1815
1916 public Task < bool > KeyCopyAsync (
2017 RedisKey sourceKey ,
2118 RedisKey destinationKey ,
2219 int destinationDatabase = - 1 ,
2320 bool replace = false ,
2421 CommandFlags flags = CommandFlags . None )
25- => Keys ( flags ) . Copy ( sourceKey , destinationKey , destinationDatabase , replace ) . AsTask ( ) ;
22+ => Context ( flags ) . Keys ( ) . Copy ( sourceKey , destinationKey , destinationDatabase , replace ) . AsTask ( ) ;
2623
2724 public bool KeyDelete ( RedisKey key , CommandFlags flags = CommandFlags . None )
28- => Keys ( flags ) . Del ( key ) . Wait ( SyncTimeout ) ;
25+ => Context ( flags ) . Keys ( ) . Del ( key ) . Wait ( SyncTimeout ) ;
2926
3027 public long KeyDelete ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
31- => Keys ( flags ) . Del ( keys ) . Wait ( SyncTimeout ) ;
28+ => Context ( flags ) . Keys ( ) . Del ( keys ) . Wait ( SyncTimeout ) ;
3229
3330 public Task < bool > KeyDeleteAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
34- => Keys ( flags ) . Del ( key ) . AsTask ( ) ;
31+ => Context ( flags ) . Keys ( ) . Del ( key ) . AsTask ( ) ;
3532
3633 public Task < long > KeyDeleteAsync ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
37- => Keys ( flags ) . Del ( keys ) . AsTask ( ) ;
34+ => Context ( flags ) . Keys ( ) . Del ( keys ) . AsTask ( ) ;
3835
3936 public byte [ ] ? KeyDump ( RedisKey key , CommandFlags flags = CommandFlags . None )
40- => Keys ( flags ) . Dump ( key ) . Wait ( SyncTimeout ) ;
37+ => Context ( flags ) . Keys ( ) . Dump ( key ) . Wait ( SyncTimeout ) ;
4138
4239 public Task < byte [ ] ? > KeyDumpAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
43- => Keys ( flags ) . Dump ( key ) . AsTask ( ) ;
40+ => Context ( flags ) . Keys ( ) . Dump ( key ) . AsTask ( ) ;
4441
4542 public string ? KeyEncoding ( RedisKey key , CommandFlags flags = CommandFlags . None )
46- => Keys ( flags ) . ObjectEncoding ( key ) . Wait ( SyncTimeout ) ;
43+ => Context ( flags ) . Keys ( ) . ObjectEncoding ( key ) . Wait ( SyncTimeout ) ;
4744
4845 public Task < string ? > KeyEncodingAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
49- => Keys ( flags ) . ObjectEncoding ( key ) . AsTask ( ) ;
46+ => Context ( flags ) . Keys ( ) . ObjectEncoding ( key ) . AsTask ( ) ;
5047
5148 public bool KeyExists ( RedisKey key , CommandFlags flags = CommandFlags . None )
52- => Keys ( flags ) . Exists ( key ) . Wait ( SyncTimeout ) ;
49+ => Context ( flags ) . Keys ( ) . Exists ( key ) . Wait ( SyncTimeout ) ;
5350
5451 public long KeyExists ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
55- => Keys ( flags ) . Exists ( keys ) . Wait ( SyncTimeout ) ;
52+ => Context ( flags ) . Keys ( ) . Exists ( keys ) . Wait ( SyncTimeout ) ;
5653
5754 public Task < bool > KeyExistsAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
58- => Keys ( flags ) . Exists ( key ) . AsTask ( ) ;
55+ => Context ( flags ) . Keys ( ) . Exists ( key ) . AsTask ( ) ;
5956
6057 public Task < long > KeyExistsAsync ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
61- => Keys ( flags ) . Exists ( keys ) . AsTask ( ) ;
58+ => Context ( flags ) . Keys ( ) . Exists ( keys ) . AsTask ( ) ;
6259
6360 public bool KeyExpire ( RedisKey key , TimeSpan ? expiry , CommandFlags flags )
64- => Keys ( flags ) . Expire ( key , expiry ) . Wait ( SyncTimeout ) ;
61+ => Context ( flags ) . Keys ( ) . Expire ( key , expiry ) . Wait ( SyncTimeout ) ;
6562
6663 public bool KeyExpire (
6764 RedisKey key ,
6865 TimeSpan ? expiry ,
6966 ExpireWhen when = ExpireWhen . Always ,
7067 CommandFlags flags = CommandFlags . None )
71- => Keys ( flags ) . Expire ( key , expiry , when ) . Wait ( SyncTimeout ) ;
68+ => Context ( flags ) . Keys ( ) . Expire ( key , expiry , when ) . Wait ( SyncTimeout ) ;
7269
7370 public bool KeyExpire ( RedisKey key , DateTime ? expiry , CommandFlags flags )
74- => Keys ( flags ) . ExpireAt ( key , expiry ) . Wait ( SyncTimeout ) ;
71+ => Context ( flags ) . Keys ( ) . ExpireAt ( key , expiry ) . Wait ( SyncTimeout ) ;
7572
7673 public bool KeyExpire (
7774 RedisKey key ,
7875 DateTime ? expiry ,
7976 ExpireWhen when = ExpireWhen . Always ,
8077 CommandFlags flags = CommandFlags . None )
81- => Keys ( flags ) . ExpireAt ( key , expiry , when ) . Wait ( SyncTimeout ) ;
78+ => Context ( flags ) . Keys ( ) . ExpireAt ( key , expiry , when ) . Wait ( SyncTimeout ) ;
8279
8380 public Task < bool > KeyExpireAsync ( RedisKey key , TimeSpan ? expiry , CommandFlags flags )
84- => Keys ( flags ) . Expire ( key , expiry ) . AsTask ( ) ;
81+ => Context ( flags ) . Keys ( ) . Expire ( key , expiry ) . AsTask ( ) ;
8582
8683 public Task < bool > KeyExpireAsync (
8784 RedisKey key ,
8885 TimeSpan ? expiry ,
8986 ExpireWhen when = ExpireWhen . Always ,
9087 CommandFlags flags = CommandFlags . None )
91- => Keys ( flags ) . Expire ( key , expiry , when ) . AsTask ( ) ;
88+ => Context ( flags ) . Keys ( ) . Expire ( key , expiry , when ) . AsTask ( ) ;
9289
9390 public Task < bool > KeyExpireAsync ( RedisKey key , DateTime ? expiry , CommandFlags flags )
94- => Keys ( flags ) . ExpireAt ( key , expiry ) . AsTask ( ) ;
91+ => Context ( flags ) . Keys ( ) . ExpireAt ( key , expiry ) . AsTask ( ) ;
9592
9693 public Task < bool > KeyExpireAsync (
9794 RedisKey key ,
9895 DateTime ? expiry ,
9996 ExpireWhen when = ExpireWhen . Always ,
10097 CommandFlags flags = CommandFlags . None )
101- => Keys ( flags ) . ExpireAt ( key , expiry , when ) . AsTask ( ) ;
98+ => Context ( flags ) . Keys ( ) . ExpireAt ( key , expiry , when ) . AsTask ( ) ;
10299
103100 public DateTime ? KeyExpireTime ( RedisKey key , CommandFlags flags = CommandFlags . None )
104- => Keys ( flags ) . PExpireTime ( key ) . Wait ( SyncTimeout ) ;
101+ => Context ( flags ) . Keys ( ) . PExpireTime ( key ) . Wait ( SyncTimeout ) ;
105102
106103 public Task < DateTime ? > KeyExpireTimeAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
107- => Keys ( flags ) . PExpireTime ( key ) . AsTask ( ) ;
104+ => Context ( flags ) . Keys ( ) . PExpireTime ( key ) . AsTask ( ) ;
108105
109106 public long ? KeyFrequency ( RedisKey key , CommandFlags flags = CommandFlags . None )
110- => Keys ( flags ) . ObjectFreq ( key ) . Wait ( SyncTimeout ) ;
107+ => Context ( flags ) . Keys ( ) . ObjectFreq ( key ) . Wait ( SyncTimeout ) ;
111108
112109 public Task < long ? > KeyFrequencyAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
113- => Keys ( flags ) . ObjectFreq ( key ) . AsTask ( ) ;
110+ => Context ( flags ) . Keys ( ) . ObjectFreq ( key ) . AsTask ( ) ;
114111
115112 public TimeSpan ? KeyIdleTime ( RedisKey key , CommandFlags flags = CommandFlags . None )
116- => Keys ( flags ) . ObjectIdleTime ( key ) . Wait ( SyncTimeout ) ;
113+ => Context ( flags ) . Keys ( ) . ObjectIdleTime ( key ) . Wait ( SyncTimeout ) ;
117114
118115 public Task < TimeSpan ? > KeyIdleTimeAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
119- => Keys ( flags ) . ObjectIdleTime ( key ) . AsTask ( ) ;
116+ => Context ( flags ) . Keys ( ) . ObjectIdleTime ( key ) . AsTask ( ) ;
120117
121118 public bool KeyMove ( RedisKey key , int database , CommandFlags flags = CommandFlags . None )
122- => Keys ( flags ) . Move ( key , database ) . Wait ( SyncTimeout ) ;
119+ => Context ( flags ) . Keys ( ) . Move ( key , database ) . Wait ( SyncTimeout ) ;
123120
124121 public Task < bool > KeyMoveAsync ( RedisKey key , int database , CommandFlags flags = CommandFlags . None )
125- => Keys ( flags ) . Move ( key , database ) . AsTask ( ) ;
122+ => Context ( flags ) . Keys ( ) . Move ( key , database ) . AsTask ( ) ;
126123
127124 public bool KeyPersist ( RedisKey key , CommandFlags flags = CommandFlags . None )
128- => Keys ( flags ) . Persist ( key ) . Wait ( SyncTimeout ) ;
125+ => Context ( flags ) . Keys ( ) . Persist ( key ) . Wait ( SyncTimeout ) ;
129126
130127 public Task < bool > KeyPersistAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
131- => Keys ( flags ) . Persist ( key ) . AsTask ( ) ;
128+ => Context ( flags ) . Keys ( ) . Persist ( key ) . AsTask ( ) ;
132129
133130 public RedisKey KeyRandom ( CommandFlags flags = CommandFlags . None )
134- => Keys ( flags ) . RandomKey ( ) . Wait ( SyncTimeout ) ;
131+ => Context ( flags ) . Keys ( ) . RandomKey ( ) . Wait ( SyncTimeout ) ;
135132
136133 public Task < RedisKey > KeyRandomAsync ( CommandFlags flags = CommandFlags . None )
137- => Keys ( flags ) . RandomKey ( ) . AsTask ( ) ;
134+ => Context ( flags ) . Keys ( ) . RandomKey ( ) . AsTask ( ) ;
138135
139136 public long ? KeyRefCount ( RedisKey key , CommandFlags flags = CommandFlags . None )
140- => Keys ( flags ) . ObjectRefCount ( key ) . Wait ( SyncTimeout ) ;
137+ => Context ( flags ) . Keys ( ) . ObjectRefCount ( key ) . Wait ( SyncTimeout ) ;
141138
142139 public Task < long ? > KeyRefCountAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
143- => Keys ( flags ) . ObjectRefCount ( key ) . AsTask ( ) ;
140+ => Context ( flags ) . Keys ( ) . ObjectRefCount ( key ) . AsTask ( ) ;
144141
145142 public bool KeyRename (
146143 RedisKey key ,
147144 RedisKey newKey ,
148145 When when = When . Always ,
149146 CommandFlags flags = CommandFlags . None )
150- => Keys ( flags ) . Rename ( key , newKey , when ) . Wait ( SyncTimeout ) ;
147+ => Context ( flags ) . Keys ( ) . Rename ( key , newKey , when ) . Wait ( SyncTimeout ) ;
151148
152149 public Task < bool > KeyRenameAsync (
153150 RedisKey key ,
154151 RedisKey newKey ,
155152 When when = When . Always ,
156153 CommandFlags flags = CommandFlags . None )
157- => Keys ( flags ) . Rename ( key , newKey , when ) . AsTask ( ) ;
154+ => Context ( flags ) . Keys ( ) . Rename ( key , newKey , when ) . AsTask ( ) ;
158155
159156 public void KeyRestore (
160157 RedisKey key ,
161158 byte [ ] value ,
162159 TimeSpan ? expiry = null ,
163160 CommandFlags flags = CommandFlags . None )
164- => Keys ( flags ) . Restore ( key , expiry , value ) . Wait ( SyncTimeout ) ;
161+ => Context ( flags ) . Keys ( ) . Restore ( key , expiry , value ) . Wait ( SyncTimeout ) ;
165162
166163 public Task KeyRestoreAsync (
167164 RedisKey key ,
168165 byte [ ] value ,
169166 TimeSpan ? expiry = null ,
170167 CommandFlags flags = CommandFlags . None )
171- => Keys ( flags ) . Restore ( key , expiry , value ) . AsTask ( ) ;
168+ => Context ( flags ) . Keys ( ) . Restore ( key , expiry , value ) . AsTask ( ) ;
172169
173170 public TimeSpan ? KeyTimeToLive ( RedisKey key , CommandFlags flags = CommandFlags . None )
174- => Keys ( flags ) . Pttl ( key ) . Wait ( SyncTimeout ) ;
171+ => Context ( flags ) . Keys ( ) . Pttl ( key ) . Wait ( SyncTimeout ) ;
175172
176173 public Task < TimeSpan ? > KeyTimeToLiveAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
177- => Keys ( flags ) . Pttl ( key ) . AsTask ( ) ;
174+ => Context ( flags ) . Keys ( ) . Pttl ( key ) . AsTask ( ) ;
178175
179176 public bool KeyTouch ( RedisKey key , CommandFlags flags = CommandFlags . None )
180- => Keys ( flags ) . Touch ( key ) . Wait ( SyncTimeout ) ;
177+ => Context ( flags ) . Keys ( ) . Touch ( key ) . Wait ( SyncTimeout ) ;
181178
182179 public long KeyTouch ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
183- => Keys ( flags ) . Touch ( keys ) . Wait ( SyncTimeout ) ;
180+ => Context ( flags ) . Keys ( ) . Touch ( keys ) . Wait ( SyncTimeout ) ;
184181
185182 public Task < bool > KeyTouchAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
186- => Keys ( flags ) . Touch ( key ) . AsTask ( ) ;
183+ => Context ( flags ) . Keys ( ) . Touch ( key ) . AsTask ( ) ;
187184
188185 public Task < long > KeyTouchAsync ( RedisKey [ ] keys , CommandFlags flags = CommandFlags . None )
189- => Keys ( flags ) . Touch ( keys ) . AsTask ( ) ;
186+ => Context ( flags ) . Keys ( ) . Touch ( keys ) . AsTask ( ) ;
190187
191188 public RedisType KeyType ( RedisKey key , CommandFlags flags = CommandFlags . None )
192- => Keys ( flags ) . Type ( key ) . Wait ( SyncTimeout ) ;
189+ => Context ( flags ) . Keys ( ) . Type ( key ) . Wait ( SyncTimeout ) ;
193190
194191 public Task < RedisType > KeyTypeAsync ( RedisKey key , CommandFlags flags = CommandFlags . None )
195- => Keys ( flags ) . Type ( key ) . AsTask ( ) ;
192+ => Context ( flags ) . Keys ( ) . Type ( key ) . AsTask ( ) ;
196193}
0 commit comments