Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
hasql Hasql.TestingKit.Statements.GenerateSeries No documentation available.
Params :: Int64 -> Int64 -> Paramshasql Hasql.TestingKit.Statements.GenerateSeries No documentation available.
-
hasql Hasql.TestingKit.Statements.WrongDecoder No documentation available.
Params :: Int64 -> Int64 -> Paramshasql Hasql.TestingKit.Statements.WrongDecoder No documentation available.
-
hasql Hasql.TestingKit.TestingDsl Composable abstraction over the execution of queries in the pipeline mode. It allows you to issue multiple queries to the server in much fewer network transactions. If the amounts of sent and received data do not surpass the buffer sizes in the driver and on the server it will be just a single roundtrip. Typically the buffer size is 8KB. This execution mode is much more efficient than running queries directly from Session, because in session every statement execution involves a dedicated network roundtrip. An obvious question rises then: why not execute all queries like that? In situations where the parameters depend on the result of another query it is impossible to execute them in parallel, because the client needs to receive the results of one query before sending the request to execute the next. This reasoning is essentially the same as the one for the difference between Applicative and Monad. That's why Pipeline does not have the Monad instance. To execute Pipeline lift it into Session via pipeline.
Examples
Insert-Many or Batch-Insert
You can use pipeline to turn a single-row insert query into an efficient multi-row insertion session. In effect this should be comparable in performance to issuing a single multi-row insert statement. Given the following definition in a Statements module:insertOrder :: Statement OrderDetails OrderId
You can lift it into the following sessioninsertOrders :: [OrderDetails] -> Session [OrderId] insertOrders orders = pipeline $ for orders $ \order -> statement order Statements.insertOrder
Combining Queries
Given the following definitions in a Statements module:selectOrderDetails :: Statement OrderId (Maybe OrderDetails) selectOrderProducts :: Statement OrderId [OrderProduct] selectOrderFinancialTransactions :: Statement OrderId [FinancialTransaction]
You can combine them into a session using the ApplicativeDo extension as follows:selectEverythingAboutOrder :: OrderId -> Session (Maybe OrderDetails, [OrderProduct], [FinancialTransaction]) selectEverythingAboutOrder orderId = pipeline $ do details <- statement orderId Statements.selectOrderDetails products <- statement orderId Statements.selectOrderProducts transactions <- statement orderId Statements.selectOrderFinancialTransactions pure (details, products, transactions)
PipelineError :: CommandError -> SessionErrorhasql Hasql.TestingKit.TestingDsl Error during the execution of a pipeline.
-
pandoc-types Text.Pandoc.Definition No documentation available.
Pandoc :: Meta -> [Block] -> Pandocpandoc-types Text.Pandoc.Definition No documentation available.
-
pandoc-types Text.Pandoc.Definition Paragraph
-
pandoc-types Text.Pandoc.Definition No documentation available.