Last active
July 25, 2019 03:34
-
-
Save hayasshi/a731edf29bede22f0a5e to your computer and use it in GitHub Desktop.
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 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