Nuke the heroku database!
heroku pg:reset DATABASE_URL
Run migration or rollback:
heroku run bash
then from the command line:
java -jar target/uberjar/<appname>.jar migrate
java -jar target/uberjar/<appname>.jar rollback
Nuke the heroku database!
heroku pg:reset DATABASE_URL
Run migration or rollback:
heroku run bash
then from the command line:
java -jar target/uberjar/<appname>.jar migrate
java -jar target/uberjar/<appname>.jar rollback
1 2 3 4 5 6 7 8 9 10 11 | (deftest game-test (jdbc/with-transaction [t-conn *db* {:rollback-only true}] (db/create-game! t-conn {:first_name "test1"}) (db/create-game! t-conn {:first_name "test2"}) (prn (count (jdbc/execute! t-conn ["SELECT * FROM games"]))) (is (= '("test1" "test2") (map :games/first_name (jdbc/execute! t-conn ["SELECT * FROM games"])))) (is (= '("test1" "test2") (map :first_name (db/list-games t-conn {})))))) |
execute!
-- executes the SQL statement and produces a vector of realized hash maps, that use qualified keywords for the column names, of the form :<table>/<column>
git checkout develop git pull git checkout -b xxxx/some-useful-name
git push
git push -f
git fetch
git rebase origin/develop
First, rewinding head to replay your work on top of it...
Applying: added staged command
git branch copy-of-my-work
Exception in thread "main" java.lang.RuntimeException: could not start [#'track-work.config/env] due to, compiling:(/tmp/form-init1269791463497202877.clj:1:73)
at clojure.lang.Compiler.load(Compiler.java:7526)
... more
Caused by: java.lang.RuntimeException: could not start [#'track-work.config/env] due to
at mount.core$up$fn__297.invoke(core.cljc:94)
... 28 more
Caused by: java.lang.RuntimeException: could not find a non empty configuration file to load. looked in the classpath (as a "resource") and on a file system via "conf" system property
at cprop.core$load_config.invokeStatic(core.cljc:24)
... 34 more
could not find a non empty configuration file to load.
is a strange way to say it could not find my config file.
lein is looking for my dev-config.edn which was never added to version control. The test-config.edn and dev-config.edn are automatically added to the .gitignore by the template.
I ran the lein template again to get a fresh copy of the dev-config.edn and test-config.edn
lein new luminus myproject +re-frame +postgres
Then used the files to create a bash script that will make a dev-config-sample.edn and test-config-sample.edn in case this ever happens again.
Maybe there is a way to ask luminus to generate the files for you again.
I started over several times with new lein projects and worked through the tutorials. Everything clicked when I learned about the helper functions which are stored in the user.clj https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl .
It turns out the luminus template I was using works with emacs/cider without any changes, if you know the correct things to do.
lein new luminus myproject +re-frame +postgres
psql
create database myproject_dev
create database myproject_test
then follow http://www.luminusweb.net/docs/database.html to setup your edn files and migrateOpen a clj file. I like to open project.clj (but don’t change anything).
Now use:, '
to start cider. Wait… you can always switch buffers to SPC b b
and choose the buffer with nrepl
in the name however eventually you will see a buffer with cider
in the name and that is the one you will use.
Or if you left you PC and went to grab a cup of coffee when you get back you should be able to use , s s
to show the cider repl buffer.
Troubleshooting:
The cider hotkeys should work when you have any .clj file open. Mine stopped working which was very confusing. To fix it I deleted my .emacs.d
directory and .spacemacs
and re-cloned spacemacs.
In this repl you can migrate your database if it changed, start the https server and figwheel.
(start)
(start-fw)
(cljs)
Now you can evaluate any expression in a cljs file using , e f
and as you change and save your cljs files you will see it update in the browser in real time.:cljs/exit
to get back to the clj prompt.Sometimes I see what args a function takes in the editor, but I have to know the name of the function. I am still not sure how to get emacs to do code completions.
(keys (ns-publics 'namespace))
That little "'" in front of your namespace is very important. otherwise you get an error that looks like
xxxxxxx
This file contains the commands you can run while you are in the user namespace.
This is a good place to look for new commands when you are working with different templates or to add the convenience you got use to.
(ns example.core)
(defn process-data (let [app-state @example.core/app-state] (example.horror/mangle! app-state)))
1 2 3 4 5 | (defonce setup-app (do (add-three-js-scene) (initialize-app) :done)) ;;setting setup-app to :done |