potamic.db

Redis DB functionality.

key-exists?

(key-exists? k conn)

Returns boolean after checking if key exists in DB.

Examples:

(require '[potamic.db :as db]
         '[potamic.queue :as q])

(def conn (db/make-conn :uri "redis://localhost:6379/0"))
;= {:spec
;=  {:uri "redis://localhost:6379/0"}
;=   :pool #taoensso.carmine.connections.ConnectionPool[..]}

(q/create-queue :my/queue conn)
;= [true nil]

(db/key-exists? :my/queue conn)
;= true

make-conn

(make-conn & opts)

Creates a connection for Redis. Returns conn or throws Potamic Error. On success, conn will be usable by potamic.queue and the underlying taoensso.carmine/wcar library.

Examples:

(require '[potamic.db :as db])

(db/make-conn :uri "redis://localhost:6379/0")
;= {:spec
;=  {:uri "redis://localhost:6379/0"}
;=   :pool #taoensso.carmine.connections.ConnectionPool[..]}