You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
940 B

4 years ago
  1. # Play with Slick 3.3
  2. This project shows Play working with Slick.
  3. This project is configured to keep all the modules self-contained.
  4. * Slick is isolated from Play, not using play-slick.
  5. * Database migration is done using [Flyway](https://flywaydb.org/), not Play Evolutions.
  6. * Slick's classes are auto-generated following database migration.
  7. ## Database Migration
  8. ```bash
  9. sbt flyway/flywayMigrate
  10. ```
  11. ## Slick Code Generation
  12. You will need to run the flywayMigrate task first, and then you will be able to generate tables using sbt-codegen.
  13. ```bash
  14. sbt slickCodegen
  15. ```
  16. ## Testing
  17. You can run functional tests against an in memory database and Slick easily with Play from a clean slate:
  18. ```bash
  19. sbt clean flyway/flywayMigrate slickCodegen compile test
  20. ```
  21. ## Running
  22. To run the project, start up Play:
  23. ```bash
  24. sbt run
  25. ```
  26. And that's it!
  27. Now go to <http://localhost:9000>, and you will see the list of users in the database.