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