Permalink
Browse files

Added full list of commands

  • Loading branch information...
abedra committed Nov 3, 2011
1 parent e996ef8 commit 9b3487471c17ab0b3ca7970d9d50fa439b422f65
Showing with 91 additions and 34 deletions.
  1. +87 −27 src/accession/core.clj
  2. +2 −1 test/accession/test/core.clj
  3. +2 −6 todo.org
View
@@ -1,5 +1,5 @@
(ns accession.core
- (:refer-clojure :exclude [get set keys])
+ (:refer-clojure :exclude [get set keys type sync])
(:require [clojure.string :as str]
[clojure.java.io :as io])
(:import (java.net Socket)
@@ -98,24 +98,59 @@
`(do ~@(map (fn [q] `(defquery ~@q)) queries)))
(defqueries
- ;; (auth [password])
+ (auth [password])
+ (quit [])
+ (select [index]) (bgwriteaof [])
+ (bgsave [])
+ (flushdb [])
+ (flushall [])
+ (dbsize [])
+ (info [])
+ (save [])
+ (sync [])
+ (lastsave [])
+ (shutdown [])
+ (slaveof [host port])
+ (slowlog [command argument])
+ ;; (config-get [parameter])
+ ;; (config-set [parameter value])
+ ;; (config-resetstat [])
;; (debug-object [key])
;; (debug-segfault)
(echo [message])
- (exists [key])
- ;; (discard [])
- ;; (exec [])
- (keys [pattern])
+ (ping [])
+ (discard [])
+ (exec [])
+ (monitor [])
+ (multi [])
+ (object [subcommand])
(set [key value])
- (get [key])
- (append [key value])
- (getset [key value])
+ (setex [key seconds value])
+ (setnx [key value])
(setbit [key offset value])
+ (mset [key value])
+ (msetnx [key value])
+ (setrange [key offset value])
+ (get [key])
+ (mget [key])
(getbit [key offset])
+ (getset [key value])
(getrange [key start end])
+ (append [key value])
+ (keys [pattern])
+ (exists [key])
+ (randomkey [])
+ (type [key])
+ (move [key db])
+ (rename [key newkey])
+ (renamenx [key newkey])
+ (strlen [key])
+ (watch [key])
+ (unwatch [key])
(del [key])
+ ;; (sort [])
(incr [key])
(incrby [key increment])
@@ -124,27 +159,32 @@
(expire [key seconds])
(expireat [key seconds])
+ (persist [key])
(ttl [key])
(llen [key])
(lpop [key])
(lpush [key value])
(lpushx [key value])
(lset [key value index])
+ (linsert [key before-after pivot value])
(lrem [key count value])
(ltrim [key start stop])
(lrange [key start end])
+ (lindex [key index])
(rpop [key])
(rpush [key value])
(rpushx [key value])
(rpoplpush [source destination])
- ;; (blpop [key timeout])
- ;; (brpop [key timeout])
- ;; (brpoplpush [source destination timeout])
+ (blpop [key timeout])
+ (brpop [key timeout])
+ (brpoplpush [source destination timeout])
(hset [key field value])
+ (hmset [key field value])
(hsetnx [key field value])
(hget [key field])
+ (hmget [key field])
(hexists [key field])
(hdel [key field])
(hgetall [key])
@@ -156,19 +196,39 @@
(sadd [key member])
(srem [key member])
(sismember [key member])
+ (smembers [key])
(sunion [set1 set2])
-
- (zadd [key score member])
- (zrange [key start end])
-
- ;; (bgwriteaof [])
- ;; (bgsave [])
-
- (flushdb [])
- (flushall [])
- (dbsize [])
- (info [])
- ;; (config-get [parameter])
- ;; (config-set [parameter value])
- ;; (config-resetstat [])
-)
+ (sunionstore [destination set1 set2])
+ (sdiff [set1 set2])
+ (sdiffstore [destination set1 set2])
+ (sinter [set1 set2])
+ (sinterstore [destination set1 set2])
+ (scard [key])
+ (smove [source desination member])
+ (spop [key])
+ (srandmember [key])
+
+ (zadd [key score member])
+ (zrange [key start end])
+ (zcard [key])
+ (zcount [key min max])
+ (zincrby [key increment member])
+ (zinterstore [destination numkeys set1 set2])
+ (zrange [key start stop])
+ (zrank [member])
+ (zrem [key member])
+ (zremrangebyrank [key start stop])
+ (zremrangebyscore [key min max])
+ (zrevrank [key member])
+ (zcore [key member])
+ (zunionstore [destination numkeys set1 set2])
+ ;; (zrevrange)
+ ;; (zrevrangebyscore)
+ ;; (zrange)
+ ;; (zrangebyscore)
+
+ (publish [channel message])
+ (subscribe [channel])
+ (unsubscribe [channel])
+ (punsubscribe [pattern])
+ (psubscribe [pattern]))
@@ -9,7 +9,8 @@
(is (= "*2\r\n$3\r\nGET\r\n$3\r\nbar\r\n" (redis/query "get" "bar"))))
(deftest test-echo
- (is (= "Message" (redis/echo "Message"))))
+ (is (= "Message" (redis/echo "Message")))
+ (is (= "PONG" (redis/ping))))
(deftest test-exists
(is (= "0" (redis/exists "singularity")))
View
@@ -3,11 +3,7 @@
** TODO Return proper values for ints, true, and false
* API
** REVIEW Create a macro that allows for command creation
-*** See redis-clojure as an example https://github.com/ragnard/redis-clojure/blob/master/src/redis.clj#L75
+*** Commands with varargs don't work
** IN-PROGRESS Create a representation of every command offered in redis
* Tests
-** DONE Create a regression suite out of the currently commented code
- CLOSED: [2011-11-02 Wed 18:24]
-*** This is just a representation of the tutorial offered on the redis site
-** TODO Create a small test for each of the redis commands to demonstrate that they work as expected
-*** This might be difficult for things like TTL
+** IN-PROGRESS Create a small test for each of the redis commands to demonstrate that they work as expected

0 comments on commit 9b34874

Please sign in to comment.