mirror of
https://github.com/nikita-volkov/hasql.git
synced 2024-11-22 01:52:45 +03:00
Update README in accordance to the new API
This commit is contained in:
parent
ab3783f2eb
commit
ba6625b725
14
README.md
14
README.md
@ -98,19 +98,19 @@ sumStatement :: Statement (Int64, Int64) Int64
|
||||
sumStatement = Statement sql encoder decoder True where
|
||||
sql = "select $1 + $2"
|
||||
encoder =
|
||||
(fst >$< Encoders.param Encoders.int8) <>
|
||||
(snd >$< Encoders.param Encoders.int8)
|
||||
decoder = Decoders.singleRow (Decoders.column Decoders.int8)
|
||||
(fst >$< Encoders.param (Encoders.nonNullable Encoders.int8)) <>
|
||||
(snd >$< Encoders.param (Encoders.nonNullable Encoders.int8))
|
||||
decoder = Decoders.singleRow (Decoders.column (Decoders.nonNullable Decoders.int8))
|
||||
|
||||
divModStatement :: Statement (Int64, Int64) (Int64, Int64)
|
||||
divModStatement = Statement sql encoder decoder True where
|
||||
sql = "select $1 / $2, $1 % $2"
|
||||
encoder =
|
||||
(fst >$< Encoders.param Encoders.int8) <>
|
||||
(snd >$< Encoders.param Encoders.int8)
|
||||
(fst >$< Encoders.param (Encoders.nonNullable Encoders.int8)) <>
|
||||
(snd >$< Encoders.param (Encoders.nonNullable Encoders.int8))
|
||||
decoder = Decoders.singleRow row where
|
||||
row =
|
||||
(,) <$>
|
||||
Decoders.column Decoders.int8 <*>
|
||||
Decoders.column Decoders.int8
|
||||
Decoders.column (Decoders.nonNullable Decoders.int8) <*>
|
||||
Decoders.column (Decoders.nonNullable Decoders.int8)
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user