开发者

Raw result rows with named fields in ScalaQuery?

In ScalaQuery, I can do this to work with the "raw" result rows:

for (
  x <- queryNA[(String,Int)]("select * from foo")(
    GetResult(r => (r.<<[String], r.<<[Int]))
  )
) {
  开发者_JAVA技巧println(x)
}

But this is entirely positional (r is a PositionedResult). Is there a way to work with the results using the column names? (E.g., row.getString("foo").)

I could use another DB API that supports this, like Querulous, but I'm already using ScalaQuery in my code for its type-safe queries, and would like to stick to just one library if possible.


From the ScalaQuery mailing list: you can get the underlying ResultSet with r.rs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜