Created
September 10, 2014 15:02
-
-
Save Miuler/febe044336b819bcdd4b to your computer and use it in GitHub Desktop.
This file contains hidden or 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.jdbc.JdbcBackend.Database | |
import Database.dynamicSession | |
import scala.slick.jdbc.StaticQuery.interpolation | |
object Main extends App { | |
Database.forURL("jdbc:postgresql://localhost:5432/miuler", user = "miuler", password = "1234", driver="org.postgresql.Driver") withDynSession { | |
val result = sql"SELECT name, age FROM user LIMIT 10".as[(String, Int)] | |
println(result.list) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment