Hello @b Maybe my example repo here can help you: • https://github.com/PrestanceDesign/usermanager-reitit-integrant-example
@admin055 this is already helpful, thanks! Now for your continued workflow, would you (def mydb (:database.sql/connection integrant.repl.state/system))
to continue working on this?
You're welcome. I'm not sure to exactly understand your question.
Assuming you're in usermanager.model.user-manager and you want to create a new function that takes db, like get-user-by-first-name
how would you write it? of course that's an easy example and the SQL would probably be right on the first try, but how would you interactively develop and test it in the running system
I use the reloaded workflow with Integrant-repl https://github.com/weavejester/integrant-repl as my example repo does. in this way it is possible to reset the app state, etc.
Which editor do you use?
I use emacs and I'm trying to use the REPL workflow
I'm sorry this may be a bit cumbersome but I'm actually not sure if other people do the kind of def
I do above or how they handle iterative development on the stateful stuff
in mount I have the state right there so I can treat it like a global (in another language), there is no disconnect between my REPL development and the application, but in integrant there has to be (at least for the parts that are iterative on the stateful stuff)
OK, I see. You want to keep continuing to iterate with the interactive REPL workflow.
So your approch seems fine for me.
is that also how you do it?
maybe I'm not seeing an alternative approach because of my habits
As you can see, my deps.edn
contains this :dev
alias https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/deps.edn#L13
yeah but there is no state, except the state that is handled by integrant.repl.state/system
I use Emacs (Spacemacs too).
I have this dir-locals file https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/.dir-locals.el when I jack-in, this allows to load integrant-repl at the level of the user
namespace of the REPL.
After that you can write your new function, require it in the user ns and call it with mydb
for eg.
so you also do the def
I did above in your running system?
okay thanks, so that's also how one does it in integrant 😄
sorry for being so difficult and thanks for your patience 🙂
It was to say that it was possible. But I think in reality with Integrant-repl it's more about using reset, etc with keyboard shortcuts as I configured for Emacs with the cider-ns-refresh hook. https://github.com/PrestanceDesign/usermanager-reitit-integrant-example/blob/main/.dir-locals.el#L5
After that I am not yet an expert so maybe others will have advice on this. 🙂
Did you already read this old post who was the first iteration of the reloaded workflow? https://www.cognitect.com/blog/2013/06/04/clojure-workflow-reloaded