Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Clarify how to use multi-db drivers (e.g. for test and deployment) #79

Open
aptogo opened this issue May 18, 2016 · 2 comments
Open

Clarify how to use multi-db drivers (e.g. for test and deployment) #79

aptogo opened this issue May 18, 2016 · 2 comments
Labels

Comments

@aptogo
Copy link

aptogo commented May 18, 2016

To create a 'DAO' class with active-slick, I need to extend a concrete JDBCProfileProfile e.g.

class CoffeeRepo extends EntityActions with H2ProfileProvider {...}

Is it possible in any way to support multiple DB types e.g. H2 for testing and Postgres for deployment? This is probably a general question for Slick rather than specifically for active-slick, but it's an issue that has troubled me since starting to look at Slick.

@octonato
Copy link
Contributor

The best way to do it is by using the Cake Pattern. You should be able to find some examples on the slick mailing list and on play-slick documentation.

However, if you use different drivers you will have to limit yourself to the drivers' common feature. None of the postgres features will be available. I would recommend the use of Docker with a Postgres for testing. It's very lightweight with the additional value that you will test against your production DB.

Here you can find an example of using the cake pattern with ActiveSlick.
https://github.com/phancox/active-slick-dynamic-provider/pull/1

@aptogo
Copy link
Author

aptogo commented May 20, 2016

Thanks. That link was very helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants