@@ -11,7 +11,7 @@ queries. The DSL lives in the `com.twitter.finagle.postgres.generic._` import.
1111The abstraction provided is the ` Query[T] ` data type, which captures a query and its parameters. It's used in conjunction
1212with the ` QueryContext ` implicit enrichment, which provides a ` sql ` String interpolator:
1313
14- ``` tut :invisible
14+ ``` scala mdoc :invisible
1515import com .twitter .finagle .Postgres
1616import com .twitter .util .Await
1717// create the client based on environment variables
@@ -30,7 +30,7 @@ Await.result(client.prepareAndExecute("INSERT INTO demo(foo) VALUES ($1)", "foo"
3030case class Demo (id : Int , foo : String )
3131```
3232
33- ``` tut:book
33+ ``` scala mdoc
3434import com .twitter .finagle .postgres .generic ._
3535
3636def insert (foo : String ) = sql " INSERT INTO demo (foo) VALUES ( $foo) "
@@ -57,7 +57,7 @@ For other types of values (like single-column results, for example) there is als
5757from the current type of a query (i.e. ` Row ` for a freshly created ` Query[Row] ` ) to some other type ` T ` , and appends the
5858function to the continuation that will map the rows. For example:
5959
60- ``` tut:book
60+ ``` scala mdoc
6161def count (input : String ) = sql " SELECT count(*) FROM demo WHERE foo = $input" .map {
6262 row => row.get[Long ](" count" )
6363}
@@ -71,6 +71,6 @@ class` with a `count` column); since there is only one row expected, we also `ma
7171just the first row using ` _.head ` .
7272
7373A more in-depth query DSL is planned, but this is the extent of what's currently offered.
74- ``` tut :invisible
74+ ``` scala mdoc :invisible
7575Await .result(client.close())
7676```
0 commit comments