I'm used to work on Ruby on Rails projects and to use the rails console
command to test all my models before doing anything else. I've recently switched to the Play Framework 2.4.x due to some choices made where I work.
I'm searching for an equivalent of this console to test my models with the database I provided inside the application.conf
(db.default.url
). How can I do this ?
Little bonus question : if it exists, is there any way to integrate it with IntelliJ ?
Try running app from play console, should load all configs
Play framework 2.0 console
In InteliJ, play console
should be found under 'tools'
Play console in InteliJ
If you're managing your project with SBT then you'll should be able to run sbt console
which is similar to the rails console, but different.
Check out the twitter Scala school tutorial: https://twitter.github.io/scala_school/sbt.html
Also note that the sbt console will not load your classes automatically like Rails does, you have to import any class you'll be using manually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With