Portability | Portable |
---|---|
Safe Haskell | Safe |
Language | Haskell2010 |
Documentation
Wrapper around Maybe
to distinguish default arguments from nullable ones
Eq a => Eq (Default a) Source # | |
Ord a => Ord (Default a) Source # | |
Read a => Read (Default a) Source # | |
Show a => Show (Default a) Source # | |
Generic (Default a) Source # | |
(ToField a, HasDB api m) => HasDB ((:>) * * (ArgPos (Default a)) api) m Source # | Deriving call to DB procedure with positional default arguments type API = ArgPos (Default Int) :> Procedure "foo" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbFoo :: Default Int -> MyMonad (Only Int) dbFoo = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) Upper example will derive the following SQL call:
|
(KnownSymbol n, ToField a, HasDB api m) => HasDB ((:>) * * (ArgNamed n (Default a)) api) m Source # | Deriving call to DB procedure with named default arguments type API = ArgNamed "a" (Defaultable Int) :> Procedure "foo" (Only Int) data MyMonad m a -- Your application monad with connection pool and logger instance HasPostgres m instance MonadLogger m dbFoo :: Defaultable Int -> MyMonad (Only Int) dbFoo = deriveDB (Proxy :: Proxy API) (Proxy :: Proxy MyMonad) Upper example will derive the following SQL call:
|
type Rep (Default a) Source # | |
type DB ((:>) * * (ArgPos (Default a)) api) m Source # | |
type DB ((:>) * * (ArgNamed n (Default a)) api) m Source # | |