playframework / play-scala-isolated-slick-example

Example Play Slick Project
https://developer.lightbend.com/start/?group=play
Creative Commons Zero v1.0 Universal
154 stars 34 forks source link

mysql config #44

Closed kwame998 closed 7 years ago

kwame998 commented 7 years ago

How to configure the Mysql database, automatically generated code?

kwame998 commented 7 years ago

-[ ] My configuration parameter is as follows: slickCodegenSettings slickCodegenDatabaseUrl := "jdbc:mysql://localhost/demo" slickCodegenDatabaseUser := "root" slickCodegenDatabasePassword := "my-secret-pw" slickCodegenDriver := slick.driver.MySQLDriver slickCodegenJdbcDriver := "com.mysql.cj.jdbc.Driver" slickCodegenOutputPackage := "com.example.user.slick" slickCodegenExcludedTables := Seq("order","User")

kwame998 commented 7 years ago

https://github.com/tototoshi/sbt-slick-codegen/issues/1

"mysql" % "mysql-connector-java" % "5.1.34"

lazy val databaseUrl = sys.env.getOrElse("DB_DEFAULT_URL", "jdbc:mysql://localhost/demo") lazy val databaseUser = sys.env.getOrElse("DB_DEFAULT_USER", "root") lazy val databasePassword = sys.env.getOrElse("DB_DEFAULT_PASSWORD", "my-secret-pw") slickCodegenSettings slickCodegenDatabaseUrl := databaseUrl slickCodegenDatabaseUser := databaseUser slickCodegenDatabasePassword := databasePassword slickCodegenDriver := slick.driver.MySQLDriver slickCodegenJdbcDriver := "com.mysql.jdbc.Driver" slickCodegenOutputPackage := "com.example.user.slick" slickCodegenExcludedTables := Seq("schema_version")