@@ -11,7 +11,7 @@ queries. The DSL lives in the `com.twitter.finagle.postgres.generic._` import.
11
11
The abstraction provided is the ` Query[T] ` data type, which captures a query and its parameters. It's used in conjunction
12
12
with the ` QueryContext ` implicit enrichment, which provides a ` sql ` String interpolator:
13
13
14
- ``` tut :invisible
14
+ ``` scala mdoc :invisible
15
15
import com .twitter .finagle .Postgres
16
16
import com .twitter .util .Await
17
17
// create the client based on environment variables
@@ -30,7 +30,7 @@ Await.result(client.prepareAndExecute("INSERT INTO demo(foo) VALUES ($1)", "foo"
30
30
case class Demo (id : Int , foo : String )
31
31
```
32
32
33
- ``` tut:book
33
+ ``` scala mdoc
34
34
import com .twitter .finagle .postgres .generic ._
35
35
36
36
def 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
57
57
from the current type of a query (i.e. ` Row ` for a freshly created ` Query[Row] ` ) to some other type ` T ` , and appends the
58
58
function to the continuation that will map the rows. For example:
59
59
60
- ``` tut:book
60
+ ``` scala mdoc
61
61
def count (input : String ) = sql " SELECT count(*) FROM demo WHERE foo = $input" .map {
62
62
row => row.get[Long ](" count" )
63
63
}
@@ -71,6 +71,6 @@ class` with a `count` column); since there is only one row expected, we also `ma
71
71
just the first row using ` _.head ` .
72
72
73
73
A more in-depth query DSL is planned, but this is the extent of what's currently offered.
74
- ``` tut :invisible
74
+ ``` scala mdoc :invisible
75
75
Await .result(client.close())
76
76
```
0 commit comments