/dynamo-embedded-clj

Test wrapper for local dynamo

Primary LanguageClojure

dynamo-embedded-clj

Embedded dynamo-local for clojure with support for apple M1 macs

Usage

Clojars Project

Development:

(require 'dynamo-embedded-clj.core)

;; Start a local dynamo with default port:
(init-dynamo)

;; another call will halt the previous system:
(init-dynamo)

;; When you're done:
(halt-dynamo!)

Testing:

NOTE: these will halt running dynamo instances

(require 'clojure.test)

(use-fixtures :once with-dynamo-fn)

(defn around-all
  [f]
  (with-dynamo-fn (merge default-config
                           {:port 8000
                            :in-memory? true
                            :shared-db? true
                            :db-path "some/path"
                            :jvm-opts ["opt1" "opt2"]})
                    f))

(use-fixtures :once around-all)

;;; You can also wrap ad-hoc code in init/halt:
(with-dynamo default-config
	,,, :do-something ,,,)