Liking cljdoc? Tell your friends :D

hara.platform.keystore


batch-inclj

(batch-in db add-map)
(batch-in db add-map remove-vec)
(batch-in db path add-map remove-vec)

batch add and removal of data

(-> (keystore) (put-in {:data {:a 1 :b 2} :input {:c 3 :d 4}}) (batch-in {:data {:x 1} :input {:y 2}} [[:data :a] [:input :d]]) (peek-in)) => {:data {:b 2, :x 1} :input {:c 3, :y 2}}

batch add and removal of data

(-> (keystore)
    (put-in {:data {:a 1
                    :b 2}
             :input {:c 3
                     :d 4}})
    (batch-in {:data {:x 1}
               :input {:y 2}}
              [[:data :a] [:input :d]])
   (peek-in))
=> {:data {:b 2, :x 1}
    :input {:c 3, :y 2}}
raw docstring

createclj

(create m)

creates a keystore that is component compatible

(keystore/create {:type :mock :file {:path "dev/scratch/test.edn" :reset true}}) ;;=> #keystore.mock<uninitiased>

creates a keystore that is component compatible

(keystore/create {:type :mock
                  :file {:path "dev/scratch/test.edn"
                         :reset true}})
;;=> #keystore.mock<uninitiased>
raw docstring

drop-inclj

(drop-in db)
(drop-in db path)

removes keys in the database

(-> (keystore) (put-in {:a 1, :b {:c 2}}) (drop-in [:a]) (peek-in)) => {:b {:c 2}}

removes keys in the database

(-> (keystore)
    (put-in {:a 1, :b {:c 2}})
    (drop-in [:a])
    (peek-in))
=> {:b {:c 2}}
raw docstring

keys-inclj

(keys-in db)
(keys-in db path)

returns all keys in the particular level

(-> (keystore) (put-in {:a 1, :b {:c 2}}) (keys-in) (sort)) => [:a :b]

returns all keys in the particular level

(-> (keystore)
    (put-in {:a 1, :b {:c 2}})
    (keys-in)
    (sort))
=> [:a :b]
raw docstring

keystoreclj

(keystore)
(keystore m)

creates an active keystore

(keystore {:type :mock :initial {:hello :world} :file {:path "dev/scratch/test.edn" :reset true :cleanup true}}) ;;=> #keystore.mock{:hello :world}

creates an active keystore

(keystore {:type :mock
           :initial {:hello :world}
           :file {:path "dev/scratch/test.edn"
                  :reset true
                  :cleanup true}})
;;=> #keystore.mock{:hello :world}
raw docstring

peek-inclj

(peek-in db)
(peek-in db path)

accesses all or part of the database

(-> (keystore) (put-in {:a 1, :b {:c 2}}) (peek-in [:b])) => {:c 2}

accesses all or part of the database

(-> (keystore)
    (put-in {:a 1, :b {:c 2}})
    (peek-in [:b]))
=> {:c 2}
raw docstring

put-inclj

(put-in db v)
(put-in db path v)

adds data to the database

(-> (keystore) (put-in [:b] {:d 2}) (put-in [:b] {:c 2}) (peek-in)) => {:b {:d 2, :c 2}}

adds data to the database

(-> (keystore)
    (put-in [:b] {:d 2})
    (put-in [:b] {:c 2})
    (peek-in))
=> {:b {:d 2, :c 2}}
raw docstring

select-inclj

(select-in db v)
(select-in db path v)

selects the key values corresponding to the query (-> (keystore) (set-in [:data] {:a 1 :b 2 :c 3 :d 4}) (select-in [:data] odd?)) => [[:a 1] [:c 3]]

selects the key values corresponding to the query
(-> (keystore)
    (set-in [:data] {:a 1
                     :b 2
                     :c 3
                     :d 4})
    (select-in [:data] odd?))
=> [[:a 1] [:c 3]]
raw docstring

set-inclj

(set-in db v)
(set-in db path v)

adds data to the database. overwrites

(-> (keystore) (set-in [:b] {:d 2}) (set-in [:b] {:c 2}) (peek-in)) => {:b {:c 2}}

adds data to the database. overwrites

(-> (keystore)
    (set-in [:b] {:d 2})
    (set-in [:b] {:c 2})
    (peek-in))
=> {:b {:c 2}}
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close