@@ -16,7 +16,7 @@
16-- or @COPY TO STDOUT@ query as documented in the link above. Then
16-- or @COPY TO STDOUT@ query as documented in the link above. Then
17-- call @getCopyData@ repeatedly until it returns 'CopyOutDone' in
17-- call @getCopyData@ repeatedly until it returns 'CopyOutDone' in
18-- the former case, or in the latter, call @putCopyData@ repeatedly
18-- the former case, or in the latter, call @putCopyData@ repeatedly
19−-- and then finish by calling either @putCopyEnd@ to proceed or
19+-- and then finish by calling either @putCopyEnd@ to proceed or
20-- @putCopyError@ to abort.
20-- @putCopyError@ to abort.
22-- You cannot issue another query on the same connection while a copy
22-- You cannot issue another query on the same connection while a copy
@@ -50,7 +50,7 @@ import Database.PostgreSQL.Simple
50import Database.PostgreSQL.Simple.Types
50import Database.PostgreSQL.Simple.Types
51import Database.PostgreSQL.Simple.Internal
51import Database.PostgreSQL.Simple.Internal
53−-- | Issue a query that changes a connection's state to @CopyIn@
53+-- | Issue a query that changes a connection's state to @CopyIn@
54-- (via a @COPY FROM STDIN@ query) or @CopyOut@ (via @COPY TO STDOUT@)
54-- (via a @COPY FROM STDIN@ query) or @CopyOut@ (via @COPY TO STDOUT@)
55-- query. Performs parameter subsitution.
55-- query. Performs parameter subsitution.
@@ -59,7 +59,7 @@ copy conn template qs = do
59 q <- formatQuery conn template qs
59 q <- formatQuery conn template qs
60 doCopy "Database.PostgreSQL.Simple.Copy.copy" conn template q
60 doCopy "Database.PostgreSQL.Simple.Copy.copy" conn template q
62−-- | Issue a query that changes a connection's state to @CopyIn@
62+-- | Issue a query that changes a connection's state to @CopyIn@
63-- (via a @COPY FROM STDIN@ query) or @CopyOut@ (via @COPY TO STDOUT@)
63-- (via a @COPY FROM STDIN@ query) or @CopyOut@ (via @COPY TO STDOUT@)
64-- query. Does not perform parameter subsitution.
64-- query. Does not perform parameter subsitution.
@@ -85,7 +85,7 @@ doCopy funcName conn template q = do
85 PQ.FatalError -> throwResultError funcName result status
85 PQ.FatalError -> throwResultError funcName result status
87data CopyOutResult
87data CopyOutResult
88− = CopyOutRow !B.ByteString -- ^ Data representing either exactly
88+ = CopyOutRow !B.ByteString -- ^ Data representing either exactly
89 -- one row of the result, or header
89 -- one row of the result, or header
90 -- or footer data depending on format.
90 -- or footer data depending on format.
91 | CopyOutDone {-# UNPACK #-} !Int64 -- ^ No more rows, and a count of the
91 | CopyOutDone {-# UNPACK #-} !Int64 -- ^ No more rows, and a count of the
@@ -93,7 +93,7 @@ data CopyOutResult
93 deriving (Eq, Typeable, Show)
93 deriving (Eq, Typeable, Show)
95-- | A connection must be in the @CopyOut@ state in order to call this
95-- | A connection must be in the @CopyOut@ state in order to call this
96−-- function, via a @COPY TO STDOUT@ query. If this returns a 'CopyOutRow',
96+-- function, via a @COPY TO STDOUT@ query. If this returns a 'CopyOutRow',
97-- the connection remains in the @CopyOut@ state, if it returns 'CopyOutDone',
97-- the connection remains in the @CopyOut@ state, if it returns 'CopyOutDone',
98-- then the connection has reverted to the ready state.
98-- then the connection has reverted to the ready state.
@@ -135,9 +135,9 @@ getCopyData conn = withConnection conn loop
136-- | A connection must be in the @CopyIn@ state in order to call this
136-- | A connection must be in the @CopyIn@ state in order to call this
137-- function, via a @COPY FROM STDIN@ query. The connection remains
137-- function, via a @COPY FROM STDIN@ query. The connection remains
138−-- in a @CopyIn@ state after this function is called. Note that
138+-- in a @CopyIn@ state after this function is called. Note that
139-- the data does not need to represent a single row, or even an
139-- the data does not need to represent a single row, or even an
140−-- integral number of rows. The net result of
140+-- integral number of rows. The net result of
141-- @putCopyData conn a >> putCopyData conn b@
141-- @putCopyData conn a >> putCopyData conn b@
142-- is the same as @putCopyData conn c@ whenever @c == BS.append a b@.
142-- is the same as @putCopyData conn c@ whenever @c == BS.append a b@.