Skip to content

Commit

Permalink
export exec command
Browse files Browse the repository at this point in the history
  • Loading branch information
fahreddinozcan committed Nov 7, 2024
1 parent bf489e8 commit d365ac7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/commands/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from "./del";
export * from "./echo";
export * from "./eval";
export * from "./evalsha";
export * from "./exec";
export * from "./exists";
export * from "./expire";
export * from "./expireat";
Expand Down
7 changes: 7 additions & 0 deletions pkg/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
EchoCommand,
EvalCommand,
EvalshaCommand,
ExecCommand,
ExistsCommand,
ExpireAtCommand,
ExpireCommand,
Expand Down Expand Up @@ -531,6 +532,12 @@ export class Redis {
...args: [sha1: string, keys: string[], args: TArgs]
) => new EvalshaCommand<TArgs, TData>(args, this.opts).exec(this.client);

/**
* Generic method to execute any Redis command.
*/
exec = <TResult>(args: [command: string, ...args: (string | number | boolean)[]]) =>
new ExecCommand<TResult>(args, this.opts).exec(this.client);

/**
* @see https://redis.io/commands/exists
*/
Expand Down

0 comments on commit d365ac7

Please sign in to comment.