Skip to content

Commit

Permalink
Merge branch 'anorm-doc-convinient' of https://github.com/cchantep/pl…
Browse files Browse the repository at this point in the history
  • Loading branch information
jroper committed Aug 20, 2014
2 parents d882b21 + 96163f3 commit 66e4e1c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions documentation/manual/scalaGuide/main/sql/ScalaAnorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,31 @@ SQL("Select name,image from Country")().map {
}
```
For types where column support is provided by Anorm, convenient functions are available to ease writing custom parsers. Each of these functions parses column either by name or index (> 1).
```scala
import anorm.SqlParser.str // String function
str("column")
str(1/* columnIndex)
```
Type | Function
------------------------|--------------
Array[Byte] | byteArray
Boolean | bool
Byte | byte
Date | date
Double | double
Float | float
InputStream<sup>1</sup> | binaryStream
Int | int
Long | long
Short | short
String | str
- 1. Type `java.io.InputStream`.
Temporal types from [Joda](http://www.joda.org) are also supported:
↓JDBC / JVM➞ | DateTime<sup>1</sup> | Instant<sup>2</sup>
Expand Down

0 comments on commit 66e4e1c

Please sign in to comment.