packages feed

hasql-cursor-transaction-0.6.6.4 / library / Hasql / CursorTransaction / Private / Statements.hs

module Hasql.CursorTransaction.Private.Statements whereimport qualified Data.Text as Textimport Hasql.CursorTransaction.Private.Preludeimport qualified Hasql.CursorTransaction.Private.Specs as Fimport qualified Hasql.Decoders as Cimport qualified Hasql.Encoders as Bimport Hasql.StatementdeclareCursor :: Text -> Text -> B.Params a -> Statement a ()declareCursor name sql encoder =  unpreparable sql' encoder C.noResult  where    sql' =      "DECLARE "        <> name        <> " NO SCROLL CURSOR FOR "        <> sqlcloseCursor :: Text -> Statement () ()closeCursor name =  preparable sql B.noParams C.noResult  where    sql =      "CLOSE " <> namefetchFromCursor :: Text -> F.BatchSize -> C.Result result -> Statement () resultfetchFromCursor name (F.BatchSize batchSize) decoder =  preparable sql encoder decoder  where    sql =      "FETCH FORWARD "        <> Text.pack (show batchSize)        <> " FROM "        <> name    encoder =      B.noParams