mirror of
https://github.com/nikita-volkov/hasql.git
synced 2024-12-26 03:56:50 +03:00
"noResult" -> "unit"
This commit is contained in:
parent
ccc13a9a9b
commit
66eee199cb
@ -4,7 +4,7 @@ module Hasql.Decoding
|
|||||||
(
|
(
|
||||||
-- * Result
|
-- * Result
|
||||||
Result,
|
Result,
|
||||||
noResult,
|
unit,
|
||||||
rowsAffected,
|
rowsAffected,
|
||||||
singleRow,
|
singleRow,
|
||||||
-- ** Specialized multi-row results
|
-- ** Specialized multi-row results
|
||||||
@ -82,9 +82,9 @@ newtype Result a =
|
|||||||
--
|
--
|
||||||
-- Useful for statements like @INSERT@ or @CREATE@.
|
-- Useful for statements like @INSERT@ or @CREATE@.
|
||||||
--
|
--
|
||||||
{-# INLINABLE noResult #-}
|
{-# INLINABLE unit #-}
|
||||||
noResult :: Result ()
|
unit :: Result ()
|
||||||
noResult =
|
unit =
|
||||||
Result (Results.single Result.unit)
|
Result (Results.single Result.unit)
|
||||||
|
|
||||||
-- |
|
-- |
|
||||||
@ -158,11 +158,11 @@ rowsList =
|
|||||||
-- ** Instances
|
-- ** Instances
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
-- | Maps to 'noResult'.
|
-- | Maps to 'unit'.
|
||||||
instance Default (Result ()) where
|
instance Default (Result ()) where
|
||||||
{-# INLINE def #-}
|
{-# INLINE def #-}
|
||||||
def =
|
def =
|
||||||
noResult
|
unit
|
||||||
|
|
||||||
-- | Maps to 'rowsAffected'.
|
-- | Maps to 'rowsAffected'.
|
||||||
instance Default (Result Int64) where
|
instance Default (Result Int64) where
|
||||||
|
@ -27,14 +27,14 @@ tree =
|
|||||||
DSL.session $ do
|
DSL.session $ do
|
||||||
let
|
let
|
||||||
query =
|
query =
|
||||||
H.Query sql mempty HD.noResult True
|
H.Query sql mempty HD.unit True
|
||||||
where
|
where
|
||||||
sql =
|
sql =
|
||||||
"drop type if exists mood"
|
"drop type if exists mood"
|
||||||
in DSL.query () query
|
in DSL.query () query
|
||||||
let
|
let
|
||||||
query =
|
query =
|
||||||
H.Query sql mempty HD.noResult True
|
H.Query sql mempty HD.unit True
|
||||||
where
|
where
|
||||||
sql =
|
sql =
|
||||||
"create type mood as enum ('sad', 'ok', 'happy')"
|
"create type mood as enum ('sad', 'ok', 'happy')"
|
||||||
|
@ -13,7 +13,7 @@ def sql =
|
|||||||
|
|
||||||
plain :: ByteString -> H.Query () ()
|
plain :: ByteString -> H.Query () ()
|
||||||
plain sql =
|
plain sql =
|
||||||
H.Query sql mempty HD.noResult False
|
H.Query sql mempty HD.unit False
|
||||||
|
|
||||||
dropType :: ByteString -> H.Query () ()
|
dropType :: ByteString -> H.Query () ()
|
||||||
dropType name =
|
dropType name =
|
||||||
|
Loading…
Reference in New Issue
Block a user