Closed elect000 closed 6 years ago
Hi,
There are a couple of things you're missing. First, mount isn't started automatically when you use lein repl
. You have to start it by running (start)
to initialize the application. Once that's done you have to run (mount.core/start #'db/*db*)
to start the db state. Note the #'
in front denoting the var as opposed to the symbol.
Thanks for your help!
~/GitHub/luminus-psql λ PORT=4000 lein repl
2018-01-03 08:58:14,900 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
nREPL server started on port 13563 on host 127.0.0.1 - nrepl://127.0.0.1:13563
REPL-y 0.3.7, nREPL 0.2.13
Clojure 1.9.0
OpenJDK 64-Bit Server VM 1.8.0_144-b01
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require '[luminus-psql.db.core :as db])
nil
user= (start)
2018-01-03 08:59:22,908 [nREPL-worker-2] INFO luminus-psql.env -
-=[luminus-psql started successfully using the development profile]=-
2018-01-03 08:59:23,222 [nREPL-worker-2] INFO luminus.http-server - starting HTTP server on port 4000
2018-01-03 08:59:23,291 [nREPL-worker-2] DEBUG io.undertow - starting undertow server io.undertow.Undertow@37d69099
2018-01-03 08:59:23,312 [nREPL-worker-2] INFO org.xnio - XNIO version 3.3.6.Final
2018-01-03 08:59:23,423 [nREPL-worker-2] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 4000
2018-01-03 08:59:23,465 [nREPL-worker-2] INFO org.projectodd.wunderboss.web.Web - Registered web context /
{:started ["#'luminus-psql.config/env" "#'luminus-psql.handler/init-app" "#'luminus-psql.core/http-server" "#'luminus-psql.db.core/*db*"]}
user=> (mount.core/start #'db/*db*)
{:started []}
user=> (db/create-user! {:id "user1" :first_name "Bob" :last_name "Bobberton" :email "bob.bobberton@mail.com" :pass "verysecret"})
1
user=> (db/get-user {:id "user1"})
{:id "user1", :first_name "Bob", :last_name "Bobberton", :email "bob.bobberton@mail.com", :admin nil, :last_login nil, :is_active nil, :pass "verysecret"}
user=>
Hello. I tried using postgresql, so, I did here in my shell
What's happen? I think db was changed Mount.core to unt.core . Thank you