Skip to content

Commit

Permalink
Migrate to newer Hasql
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed May 27, 2019
1 parent 64d2c65 commit d93822f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hasql-cursor-transaction.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ library
bytestring-tree-builder ==0.2.*,
contravariant >=1.3 && <2,
contravariant-extras >=0.3.3.1 && <0.4,
hasql >=1.3 && <1.4,
hasql >=1.4 && <1.5,
hasql-transaction >=0.7 && <0.8,
transformers >=0.4 && <0.6
6 changes: 3 additions & 3 deletions library/Hasql/CursorTransaction/Private/Statements.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import qualified ByteString.TreeBuilder as D

declareCursor :: ByteString -> ByteString -> B.Params a -> Statement a ()
declareCursor name sql encoder =
Statement sql' encoder C.unit False
Statement sql' encoder C.noResult False
where
sql' =
D.toByteString $
"DECLARE " <> D.byteString name <> " NO SCROLL CURSOR FOR " <> D.byteString sql

closeCursor :: ByteString -> Statement () ()
closeCursor name =
Statement sql B.unit C.unit True
Statement sql B.noParams C.noResult True
where
sql =
"CLOSE " <> name
Expand All @@ -32,4 +32,4 @@ fetchFromCursor name (F.BatchSize batchSize) decoder =
D.toByteString $
"FETCH FORWARD " <> D.asciiIntegral batchSize <> " FROM " <> D.byteString name
encoder =
B.unit
B.noParams

0 comments on commit d93822f

Please sign in to comment.