Fork me on GitHub
#luminus
<
2018-03-17
>
lepistane13:03:07

just made new template for using psql but i am getting db-spec mount.core.DerefableState@1eb6f936 is missing a required parameter if i try to use function defined in queries.sql i run project by user/start

lepistane13:03:12

what am i missing?

lepistane13:03:01

and i've successfully ran migration so configs work

yogthos13:03:23

@lepistane it looks like the db state isn't started, if it's not referenced anywhere then running (user/start) won't start the database

yogthos13:03:54

mount resolves states based on the namespace hierarchy, so if you have a defstate in a namespaced that isn't referenced in the project, it's ignored

yogthos13:03:26

you can start it explicitly by running (mount.core/start #'<ns>/<state>)

yogthos13:03:48

but in most cases it's better to just reference the namespace where you'll end up using it

lepistane13:03:06

as far as i remember it used to be when i use (user/start) from the repl i could access functions defined in queries.sql using project.db.core :as db then db/create-user! {:something "else"} and it would work now same flow gives me errors i even checked my old project made by following ur book and it works as expected

lepistane14:03:21

either i am doing something wrong or there is bug with newest template i just restared my pc tried getting newest template and running migrations they got stuck

lein run migration
2018-03-17 15:02:04,982 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider 
2018-03-17 15:02:05,799 [main] INFO  twd.env - 
-=[twd started successfully using the development profile]=- 
2018-03-17 15:02:06,383 [main] INFO  luminus.http-server - starting HTTP server on port 3000 
2018-03-17 15:02:06,486 [main] DEBUG io.undertow - starting undertow server io.undertow.Undertow@45c03831 
2018-03-17 15:02:06,522 [main] INFO  org.xnio - XNIO version 3.3.6.Final 
2018-03-17 15:02:06,852 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 3000 
2018-03-17 15:02:06,986 [main] INFO  org.projectodd.wunderboss.web.Web - Registered web context / 
2018-03-17 15:02:06,988 [main] INFO  luminus.repl-server - starting nREPL server on port 7000 
2018-03-17 15:02:07,021 [main] INFO  twd.core - #'twd.config/env started 
2018-03-17 15:02:07,022 [main] INFO  twd.core - #'twd.handler/init-app started 
2018-03-17 15:02:07,022 [main] INFO  twd.core - #'twd.handler/app started 
2018-03-17 15:02:07,022 [main] INFO  twd.core - #'twd.core/http-server started 
2018-03-17 15:02:07,022 [main] INFO  twd.core - #'twd.core/repl-server started 
seems like db namespace isnt getting loaded

yogthos14:03:07

is the db namespace referenced somewhere though?

lepistane07:03:07

i found solution, it was referenced but there was typo in the code which made it not load btw mount is amazing!

yogthos12:03:18

when you have a function with a single argument, parens are optional in threading macros

eggsyntax14:03:22

@yogthos starting a big new web app for the first time in a while, and Luminus, as always, has been a godsend. I don't think I've thanked you for it in the last year, so -- thanks! It remains (IMHO) by far the best way to start a new clj/s web app.