Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions internal/cmd/cmd_decr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand Down Expand Up @@ -32,8 +33,10 @@ OK
localhost:7379> DECR k2
ERR wrongtype operation against a key holding the wrong kind of value
`,
Eval: evalDECR,
Execute: executeDECR,
Eval: evalDECR,
Execute: executeDECR,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RM | flg.ACCESS | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_decrby.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"strconv"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand All @@ -32,8 +33,10 @@ OK -50
localhost:7379> GET k2
OK "-50"
`,
Eval: evalDECRBY,
Execute: executeDECRBY,
Eval: evalDECRBY,
Execute: executeDECRBY,
Arity: 3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RM | flg.ACCESS | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_del.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand All @@ -24,8 +25,10 @@ localhost:7379> SET k2 v2
OK
localhost:7379> DEL k1 k2 k3
OK 2`,
Eval: evalDEL,
Execute: executeDEL,
Eval: evalDEL,
Execute: executeDEL,
Arity: -2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RM | flg.DELETE},
}

func init() {
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/cmd_echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ localhost:7379> ECHO dicedb
OK dicedb`,
Eval: evalECHO,
Execute: executeECHO,
Arity: 1,
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_exists.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shard"
"github.com/dicedb/dice/internal/shardmanager"
Expand All @@ -24,8 +25,10 @@ OK
localhost:7379> EXISTS k1 k2 k3
OK 2
`,
Eval: evalEXISTS,
Execute: executeEXISTS,
Eval: evalEXISTS,
Execute: executeEXISTS,
Arity: -2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_expire.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strconv"
"time"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand Down Expand Up @@ -43,8 +44,10 @@ OK true
localhost:7379> EXPIRE k2 20 NX
OK false
`,
Eval: evalEXPIRE,
Execute: executeEXPIRE,
Eval: evalEXPIRE,
Execute: executeEXPIRE,
Arity: -3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Step: 1, Flags: flg.RW | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_expireat.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strconv"
"time"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand Down Expand Up @@ -40,8 +41,10 @@ OK false
localhost:7379> EXPIREAT k1 1740829942 XX
OK false
`,
Eval: evalEXPIREAT,
Execute: executeEXPIREAT,
Eval: evalEXPIREAT,
Execute: executeEXPIREAT,
Arity: -3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_expiretime.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand All @@ -28,8 +29,10 @@ OK true
localhost:7379> EXPIRETIME k1
OK 1744451192
`,
Eval: evalEXPIRETIME,
Execute: executeEXPIRETIME,
Eval: evalEXPIRETIME,
Execute: executeEXPIRETIME,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO | flg.ACCESS},
}

func init() {
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/cmd_flushdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ OK ""
`,
Eval: evalFLUSHDB,
Execute: executeFLUSHDB,
Arity: -1,
}

func init() {
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/cmd_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"fmt"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand Down Expand Up @@ -33,6 +34,8 @@ OK ""
Eval: evalGET,
Execute: executeGET,
IsWatchable: true,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO | flg.ACCESS},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_getdel.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand All @@ -28,8 +29,10 @@ OK "v"
localhost:7379> GET k
OK ""
`,
Eval: evalGETDEL,
Execute: executeGETDEL,
Eval: evalGETDEL,
Execute: executeGETDEL,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.ACCESS | flg.DELETE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_getex.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand Down Expand Up @@ -52,8 +53,10 @@ OK "v"
localhost:7379> EXPIRETIME k
OK -1
`,
Eval: evalGETEX,
Execute: executeGETEX,
Eval: evalGETEX,
Execute: executeGETEX,
Arity: -2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.ACCESS | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_getset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand All @@ -28,8 +29,10 @@ OK "v1"
localhost:7379> GET k1
OK "v2"
`,
Eval: evalGETSET,
Execute: executeGETSET,
Eval: evalGETSET,
Execute: executeGETSET,
Arity: 3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.ACCESS | flg.UPDATE},
}

func init() {
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/cmd_hget.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand Down Expand Up @@ -32,6 +33,8 @@ OK ""
Eval: evalHGET,
Execute: executeHGET,
IsWatchable: true,
Arity: 3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO | flg.ACCESS},
}

func init() {
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/cmd_hgetall.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand Down Expand Up @@ -34,6 +35,8 @@ OK
Eval: evalHGETALL,
Execute: executeHGETALL,
IsWatchable: true,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO | flg.ACCESS},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_hset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand All @@ -28,8 +29,10 @@ OK 1
localhost:7379> HSET k1 f1 v1 f2 v2 f3 v3
OK 2
`,
Eval: evalHSET,
Execute: executeHSET,
Eval: evalHSET,
Execute: executeHSET,
Arity: -4,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_incr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package cmd

import (
flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand All @@ -30,8 +31,10 @@ OK 1
localhost:7379> GET k2
OK "1"
`,
Eval: evalINCR,
Execute: executeINCR,
Eval: evalINCR,
Execute: executeINCR,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.ACCESS | flg.RW | flg.UPDATE},
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_incrby.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"strconv"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand Down Expand Up @@ -33,8 +34,10 @@ OK 50
localhost:7379> GET k2
OK "50"
`,
Eval: evalINCRBY,
Execute: executeINCRBY,
Eval: evalINCRBY,
Execute: executeINCRBY,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.UPDATE | flg.ACCESS | flg.RW},
}

func init() {
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/cmd_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ OK
`,
Eval: evalKEYS,
Execute: executeKEYS,
Arity: 2,
}

func init() {
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/cmd_ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ OK "PONG dicedb"
`,
Eval: evalPING,
Execute: executePING,
Arity: -1,
}

func init() {
Expand Down
8 changes: 6 additions & 2 deletions internal/cmd/cmd_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"strings"
"time"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/object"
"github.com/dicedb/dice/internal/shardmanager"
Expand Down Expand Up @@ -59,8 +60,11 @@ OK
localhost:7379> SET k 43 KEEPTTL
OK
`,
Eval: evalSET,
Execute: executeSET,
Eval: evalSET,
Execute: executeSET,
Arity: -3,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RW | flg.ACCESS | flg.UPDATE | flg.VARIABLEFLAGS},
GetFlags: flg.SetGetKeys,
}

func init() {
Expand Down
7 changes: 5 additions & 2 deletions internal/cmd/cmd_ttl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd
import (
"time"

flg "github.com/dicedb/dice/internal"
"github.com/dicedb/dice/internal/errors"
"github.com/dicedb/dice/internal/shardmanager"
dstore "github.com/dicedb/dice/internal/store"
Expand Down Expand Up @@ -34,8 +35,10 @@ OK 8
localhost:7379> TTL kn
OK -2
`,
Eval: evalTTL,
Execute: executeTTL,
Eval: evalTTL,
Execute: executeTTL,
Arity: 2,
KeySpecs: flg.KeySpecs{BeginIndex: 1, Flags: flg.RO | flg.ACCESS},
}

func init() {
Expand Down
Loading