hasql/testing-kit/Hasql/TestingKit/Statements/BrokenSyntax.hs
Nikita Volkov 864767b86a Remove rerebase from the internal library deps
As a workaround for Hackage including the dependencies of internal libs in the public list of package dependencies.
2024-04-28 15:12:50 +03:00

45 lines
1.1 KiB
Haskell

module Hasql.TestingKit.Statements.BrokenSyntax where
import Hasql.Decoders qualified as Decoders
import Hasql.Encoders qualified as Encoders
import Hasql.Pipeline qualified as Pipeline
import Hasql.Session qualified as Session
import Hasql.Statement qualified as Statement
import Hasql.TestingKit.Preludes.Base
data Params = Params
{ start :: Int64,
end :: Int64
}
type Result = [Int64]
session :: Bool -> Params -> Session.Session Result
session prepared params =
Session.statement params (statement prepared)
pipeline :: Bool -> Params -> Pipeline.Pipeline Result
pipeline prepared params =
Pipeline.statement params (statement prepared)
statement :: Bool -> Statement.Statement Params Result
statement =
Statement.Statement sql encoder decoder
sql :: ByteString
sql =
"S"
encoder :: Encoders.Params Params
encoder =
mconcat
[ start >$< Encoders.param (Encoders.nonNullable Encoders.int8),
end >$< Encoders.param (Encoders.nonNullable Encoders.int8)
]
decoder :: Decoders.Result Result
decoder =
Decoders.rowList
( Decoders.column (Decoders.nonNullable Decoders.int8)
)