Go to file
Rohan Sircar cb9524eac7 Many changes
Rewrote slick db service using monix task instead of future
Added cats IO to controller to make use of above db service
Added action methods that support effect wrappers other than future
Added play-flyway to auto-manage migrations
Moved migration files to appropriate directory as a result of above
Added cors filter to work with separately hosted frontend
Made logger log at debug
2020-08-22 16:18:11 +05:30
app Many changes 2020-08-22 16:18:11 +05:30
conf Many changes 2020-08-22 16:18:11 +05:30
modules Many changes 2020-08-22 16:18:11 +05:30
project Removed files from git 2020-08-19 20:36:56 +05:30
public first commit 2020-05-16 15:40:23 +05:30
scripts first commit 2020-05-16 15:40:23 +05:30
test/controller first commit 2020-05-16 15:40:23 +05:30
.gitignore Updated gitignore 2020-08-19 20:37:44 +05:30
.scalafmt.conf first commit 2020-05-16 15:40:23 +05:30
build.sbt Many changes 2020-08-22 16:18:11 +05:30
README.md first commit 2020-05-16 15:40:23 +05:30

Play with Slick 3.3

This project shows Play working with Slick.

This project is configured to keep all the modules self-contained.

  • Slick is isolated from Play, not using play-slick.
  • Database migration is done using Flyway, not Play Evolutions.
  • Slick's classes are auto-generated following database migration.

Database Migration

sbt flyway/flywayMigrate

Slick Code Generation

You will need to run the flywayMigrate task first, and then you will be able to generate tables using sbt-codegen.

sbt slickCodegen

Testing

You can run functional tests against an in memory database and Slick easily with Play from a clean slate:

sbt clean flyway/flywayMigrate slickCodegen compile test

Running

To run the project, start up Play:

sbt run

And that's it!

Now go to http://localhost:9000, and you will see the list of users in the database.