Publish to my blog (weekly)

    • DATABASE_URL environment variable in the same way as the default Play JBDC connection pool. But starting in version 3.0.3, Slick provides a DatabaseUrlDataSource specifically for parsing the environment variable.

       
      slick.dbs.default.driver="slick.driver.PostgresDriver$" slick.dbs.default.db.dataSourceClass = "slick.jdbc.DatabaseUrlDataSource" slick.dbs.default.db.properties.driver = "org.postgresql.Driver"
       

      On some platforms, such as Heroku, you may substitute the JDBC_DATABASE_URL, which is in the format jdbc:vendor://host:port/db?args, if it is available. For example:

       
      slick.dbs.default.driver="slick.driver.PostgresDriver$" slick.dbs.default.db.driver="org.postgresql.Driver" slick.dbs.default.db.url=${JDBC_DATABASE_URL}
    • val userId =  (users returning users.map(_.id)) += User(None, "Stefan", "Zeiger")
    • userWithId =  (users returning users.map(_.id)  into ((user,id) => user.copy(id=Some(id)))  ) += User(None, "Stefan", "Zeiger")

Posted from Diigo. The rest of my favorite links are here.

댓글

이 블로그의 인기 게시물

Publish to my blog (weekly)

Publish to my blog (weekly)