Julio Faerman
Julio Faerman

Reputation: 13501

How to reference a column by name in slick plain SQL?

I would like to use named references instead of positional in GetResult, so that instead of this:

implicit val getCoffeeResult = GetResult(r => Coffee(r.<<, r.<<, r.<<))

i could write something like this:

implicit val getCoffeeResult = GetResult(r => Coffee(r.get("name"), r.get("supID"),r.get("price")))

I can has named result?

Upvotes: 0

Views: 1184

Answers (1)

Faruk Sahin
Faruk Sahin

Reputation: 8726

You can get it through the resultset:

r.rs.getString("name")

Upvotes: 4

Related Questions