Skip to content

qx__playground_setup

RichMorin edited this page Dec 31, 2012 · 8 revisions

Ignored

Playground Setup

This setup (and teardown) code comes from the core.clj file in Devin Walter's nifty codeq-playground.

Setup

(ns com.thinkslate.codeq-playground.core
  (:require [datomic.api    :as    d]
            [clojure.pprint :refer [pprint]]))

Set up a couple of "helper" definitions.

Note: Change the db-name string to the value you used when running ./script/analyze-repo.

(def db-name "clojure")
(def uri     (str "datomic:free://localhost:4334/" db-name))

Connect to the database server, then get a handle for the database.

(def conn    (d/connect uri))
(def db      (d/db      conn))

Teardown

When you're done with the database, delete it.

(d/delete-database uri)

Discussion

See Also

Clone this wiki locally