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
.
精彩评论