Skip to content

Instantly share code, notes, and snippets.

@Miuler
Created September 10, 2014 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Miuler/febe044336b819bcdd4b to your computer and use it in GitHub Desktop.
Save Miuler/febe044336b819bcdd4b to your computer and use it in GitHub Desktop.
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