File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
src/Database/PostgreSQL/Protocol Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
- module Database.PostgreSQL.Protocol.Encoders where
1
+ module Database.PostgreSQL.Protocol.Encoders
2
+ ( encodeStartMessage
3
+ , encodeClientMessage
4
+ ) where
2
5
3
- import Data.Word
4
- import Data.Int
5
- import Data.Monoid
6
- import Data.Foldable
6
+ import Data.Int (Int32 )
7
+ import Data.Monoid ((<>) )
7
8
import qualified Data.Vector as V
8
9
import qualified Data.ByteString as B
9
10
@@ -72,7 +73,7 @@ encodeClientMessage Sync
72
73
encodeClientMessage Terminate
73
74
= prependHeader ' X' mempty
74
75
75
- -- Encodes single data values. Length `-1` indicates a NULL parameter value.
76
+ -- | Encodes single data values. Length `-1` indicates a NULL parameter value.
76
77
-- No value bytes follow in the NULL case.
77
78
encodeValue :: Maybe B. ByteString -> Encode
78
79
encodeValue Nothing = putInt32BE (- 1 )
@@ -83,10 +84,6 @@ encodeFormat :: Format -> Encode
83
84
encodeFormat Text = putInt16BE 0
84
85
encodeFormat Binary = putInt16BE 1
85
86
86
- ----------
87
- -- Utils
88
- ---------
89
-
90
87
prependHeader :: Char -> Encode -> Encode
91
88
prependHeader c payload =
92
89
-- Length includes itself but not the first message-type byte
You can’t perform that action at this time.
0 commit comments