Skip to content

Instantly share code, notes, and snippets.

@hayasshi
Last active July 25, 2019 03:34
Show Gist options
  • Save hayasshi/a731edf29bede22f0a5e to your computer and use it in GitHub Desktop.
Save hayasshi/a731edf29bede22f0a5e to your computer and use it in GitHub Desktop.
import scala.slick.driver.JdbcDriver.simple._
val db = Database.forURL("jdbc:h2:mem:slicktest", driver = "org.h2.Driver")
implicit val session = db.createSession()
session.close()
db.withSession { implicit session =>
// query
}
db.withTransaction { implicit session =>
// query
}
val connection: java.sql.Connection = db.createConnection()
connection.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment