Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instruction for running evolutions with Slick using compile-time DI #402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/manual/working/scalaGuide/main/sql/slick/PlaySlick.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ Note there is no need to add the Play `evolutions` component to your dependencie

> **Note**: You can see th

#### Running evolutions with Slick using compile-time DI
If you are using Slick, you will also need to mix in the `SlickEvolutionsComponents` trait in addition to the `EvolutionsComponents` trait to `ApplicationComponents`. Else evolutions will not recognize the Slick database configurations in the configuration files.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be good to add a code sample here. You can see the recommended way of adding code samples here:

https://playframework.com/documentation/2.5.x/Documentation#Code-samples

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, what do you think about changing the name to SlickDBComponents instead of SlickEvolutionsComponents? That would make things more straightforward since this basically replaces DBComponents. Then we can deprecate the whole trait instead of just that api method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmethvin +1.

### JDBC driver dependency

The Play Slick module does not bundle any JDBC driver. Hence, you will need to explicitly add the JDBC driver(s) you want to use in your application. For instance, if you would like to use an in-memory database such as H2, you will have to add a dependency to it:
Expand Down