slick-examples icon indicating copy to clipboard operation
slick-examples copied to clipboard

Embedding example would be helpful

Open mslinn opened this issue 12 years ago • 1 comments

How about an example along these lines?

    @table("COFFEES") case class Coffee(
    @column("COF_NAME") name: String,
    @column("SUP_ID") supID: Int,
    @column("PRICE") price: Double
    )
    val coffees = Queryable[Coffee]

    // for inserts use lifted embedding or SQL

    val l = for {
    c <- coffees if c.supID == 101
    // ^ comparing Int to Int!
    } yield (c.name, c.price)

    backend.result( l, session )
    .foreach { case (n, p) => println(n + ": " + p) }

mslinn avatar Oct 11 '12 21:10 mslinn

Agreed. Assigning Chris to this.

szeiger avatar Oct 12 '12 09:10 szeiger