我使用lein repl
commond来测试项目数据库的某些操作。但我无法连接到它。
然后我发现问题是数据库没有加载。我能够尝试的唯一解决方案是:
lein run
这导致以下消息:
2018-04-24 12:23:07,397 [main] INFO guestbook.core - #'guestbook.db.core/*db* started
2018-04-24 12:23:07,398 [main] INFO guestbook.core - #'guestbook.handler/init-app started
2018-04-24 12:23:07,398 [main] INFO guestbook.core - #'guestbook.handler/app started
2018-04-24 12:23:07,398 [main] INFO guestbook.core - #'guestbook.core/http-server started
2018-04-24 12:23:07,398 [main] INFO guestbook.core - #'guestbook.core/repl-server started
然后我运行了以下命令:
lein repl :connect 7000
this connected to database and started repl. next commands worked fine:
user=> (use 'guestbook.db.core)
nil
user=> (get-messages)
nil
如果还有其他方法,请告诉我?