SLICK / ScalaQuery 0.10.0-M1 and StaticQuery

227 views
Skip to first unread message

RanUser

unread,
May 24, 2012, 3:47:23 AM5/24/12
to ScalaQuery
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?

-

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
}

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.


Thanks!

Stefan Zeiger

unread,
May 24, 2012, 5:00:40 AM5/24/12
to scala...@googlegroups.com
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?

Postgres is supported in M1 (and listed in https://github.com/slick/slick/blob/0.10.0-M1/README.txt) which is still based on the old AST / driver model. Postgres support for the new driver model is back in master since yesterday: https://github.com/slick/slick/commit/82d132c20258d49deb0073a7f7cbe56bd82392f4


I will need to pass Array[Byte] to postgreql stored procedure.  I'm
hoping StaticQuery will allow this.

Yes.

--
Stefan Zeiger
Typesafe - The software stack for applications that scale
Twitter: @StefanZeiger

RanUser

unread,
May 24, 2012, 1:34:07 PM5/24/12
to ScalaQuery
Many thanks!
> Postgres is supported in M1 (and listed inhttps://github.com/slick/slick/blob/0.10.0-M1/README.txt) which is still
> based on the old AST / driver model. Postgres support for the new driver
> model is back in master since yesterday:https://github.com/slick/slick/commit/82d132c20258d49deb0073a7f7cbe56...
>
> > I will need to pass Array[Byte] to postgreql stored procedure.  I'm
> > hoping StaticQuery will allow this.
>
> Yes.
>
> --
> Stefan Zeiger
> Typesafe <http://typesafe.com> - The software stack for applications
> that scale
> Twitter: @StefanZeiger <http://twitter.com/#%21/StefanZeiger>
Reply all
Reply to author
Forward
0 new messages