On 2012-05-24 9:47, RanUser wrote:
3 questions :)
1)
I am running Scala 2.9.2
In SBT I have:
val scalaQuery = "org.scalaquery" % "scalaquery_2.9.1-1" % "0.10.0-M1"
But I don't have any of the scala.slick.* packages . Are they
available in any of the repos?
M1 was released before the package structure changed and the new
front-end was merged in. There are no published releases with the
new packages yet. (We haven't even decided on the right groupId or
gotten the permission to publish to it). There are also much bigger
changes under the hood between M1 and the new-ast branch (which was
merged into master after M1).
2)
From the test at scala.slick.test.jdbc.SimpleTest , can anyone explain
a) the purpose of the implicit, and b) what the r.<< parts are doing?
implicit val getUserResult = GetResult(r => new User(r.<<, r.<<))
@Test def testSimple() {
def getUsers(id: Option[Int]) = {
val q = Q[User] + "select id, name from users "
id map { q + "where id =" +? _ } getOrElse q
}
Q[User] requires a GetResult[User] in order to read User objects
from a PositionedResult. r.<< is simply
r.nextWhateverTypeYouNeed. You could use new User(r.nextInt,
r.nextString) if you wanted to be explicit.
3)
Lastly, the little I can find about SLICK online omits postgresql from
the M1 notes. Is postgresql working in M1, is any functionality
missing?
I will need to pass Array[Byte] to postgreql stored procedure. I'm
hoping StaticQuery will allow this.