Last active
October 9, 2019 16:17
-
-
Save dalegaspi/dcbd597522e2637ddb51a685b37832f3 to your computer and use it in GitHub Desktop.
Using Postgesql with TypeSafe Slick 3.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import slick.jdbc.PostgresProfile.api._ | |
val sqldb = Database.forConfig("yomama.postgres") | |
// profit! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Typesafe's documentation is wrong, every StackOverflow answer as of 08/31/2016 is no longer valid | |
# this is how you set your application.conf | |
# JDBC setting | |
yomama { | |
postgres { | |
dataSourceClass = "slick.jdbc.DatabaseUrlDataSource" | |
properties { | |
#driver = "slick.driver.PostgresDriver$" | |
driver ="org.postgresql.Driver" | |
url = "postgres://POSTGRES_SERVER:POSTGRES_PORT/POSTGRES_DB" | |
user = "USERNAME" | |
password = "PASSWORD" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for use with your build.sbt | |
object Dependencies { | |
// ... all your other dependencies | |
val typesafeSlick = "com.typesafe.slick" %% "slick" % "3.1.1" | |
val postgreSql = "org.postgresql" % "postgresql" % "9.4.1209" | |
val hikariCP = "com.typesafe.slick" %% "slick-hikaricp" % "3.1.0" // you need really need this or you get ClassNotFoundException | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sergigp. 👍