replikativ / datahike-postgres

Datahike with Postgres as data storage
Eclipse Public License 1.0
17 stars 2 forks source link

create-database causes error on lein uberjar #4

Open npafitis opened 4 years ago

npafitis commented 4 years ago

I have a very simple project that i generated using luminus. The project is basically empty but i have this file:

(ns clan.db.core
  (:require [datahike.api :as d]
            [datahike-postgres.core]
            [mount.core :as mount]))

(def datahike-cfg {:backend  :pg
                   :host     "localhost"
                   :port     5432
                   :username "postgres"
                   :password "postgres"
                   :path     "/clan"})

(d/create-database datahike-cfg)

(mount/defstate conn
                :start (d/connect datahike-cfg))

When running lein uberjar i get the following error:

Compiling clan.db.core
Syntax error macroexpanding at (core.clj:13:1).
Execution error (ExceptionInfo) at konserve-pg.core/new-pg-store$fn$state-machine$fn$fn (core.clj:153).
Cannot connect to PostgreSQL.

Full report at:
/tmp/clojure-3147988878089586605.edn
Compilation failed: Subprocess failed

If i remove the (d/create-database ...) line the project will compile just fine. My question is why would that function be called on compilation? Any help would be much appreciated.