Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Only a = Only {
- fromOnly :: a
- newtype Binary a = Binary {
- fromBinary :: a
- newtype PGArray a = PGArray {
- fromPGArray :: [a]
- mandatory :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m b
- mandatory_ :: (MonadDb m, FromRow a) => Query -> m a
- unique :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m (Maybe b)
- unique_ :: (MonadDb m, FromRow a) => Query -> m (Maybe a)
- query :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m [b]
- query_ :: (MonadDb m, FromRow a) => Query -> m [a]
- execute :: (MonadDb m, ToRow a) => Query -> a -> m Int64
- execute_ :: MonadDb m => Query -> m Int64
- explain :: (MonadDb m, ToRow a) => Query -> a -> m Text
- explain_ :: MonadDb m => Query -> m Text
- value :: Functor f => f (Only a) -> f a
- valueWith :: Functor f => (a -> b) -> f (Only a) -> f b
- values :: (Functor f, Functor g) => g (f (Only a)) -> g (f a)
- valuesWith :: (Functor f, Functor g) => (a -> b) -> g (f (Only a)) -> g (f b)
- newtype Schema = Schema {
- renderSchema :: Text
- newSchema :: Text -> Maybe Schema
- newtype Savepoint = Savepoint {}
- newSavepoint :: Text -> Maybe Savepoint
- createSavepoint :: Savepoint -> Db ()
- releaseSavepoint :: Savepoint -> Db ()
- rollbackSavepoint :: Savepoint -> Db ()
- data Unique a
- isUnique :: Unique a -> Bool
- isDuplicate :: Unique a -> Bool
- withUniqueCheck :: MonadDb m => Db a -> m (Unique a)
- withUniqueCheckSavepoint :: MonadDb m => Savepoint -> Db a -> m (Unique a)
Documentation
The 1-tuple type or single-value "collection".
This type is structurally equivalent to the
Identity
type, but its intent is more
about serving as the anonymous 1-tuple type missing from Haskell for attaching
typeclass instances.
Parameter usage example:
encodeSomething (Only
(42::Int))
Result usage example:
xs <- decodeSomething
forM_ xs $ \(Only
id) -> {- ... -}
Instances
Functor Only | |
Eq a => Eq (Only a) | |
Data a => Data (Only a) | |
Defined in Data.Tuple.Only gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Only a -> c (Only a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Only a) # toConstr :: Only a -> Constr # dataTypeOf :: Only a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Only a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Only a)) # gmapT :: (forall b. Data b => b -> b) -> Only a -> Only a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Only a -> r # gmapQ :: (forall d. Data d => d -> u) -> Only a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Only a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Only a -> m (Only a) # | |
Ord a => Ord (Only a) | |
Read a => Read (Only a) | |
Show a => Show (Only a) | |
Generic (Only a) | |
NFData a => NFData (Only a) | |
Defined in Data.Tuple.Only | |
FromField a => FromRow (Maybe (Only a)) | |
FromField a => FromRow (Only a) | |
Defined in Database.PostgreSQL.Simple.FromRow | |
ToField a => ToRow (Only a) | |
Defined in Database.PostgreSQL.Simple.ToRow | |
type Rep (Only a) | |
Defined in Data.Tuple.Only |
Wrap binary data for use as a bytea
value.
Binary | |
|
Instances
Functor Binary | |
Eq a => Eq (Binary a) | |
Ord a => Ord (Binary a) | |
Defined in Database.PostgreSQL.Simple.Types | |
Read a => Read (Binary a) | |
Show a => Show (Binary a) | |
FromField (Binary ByteString) | bytea |
Defined in Database.PostgreSQL.Simple.FromField | |
FromField (Binary ByteString) | bytea |
Defined in Database.PostgreSQL.Simple.FromField | |
ToField (Binary ByteString) | |
Defined in Database.PostgreSQL.Simple.ToField toField :: Binary ByteString -> Action # | |
ToField (Binary ByteString) | |
Defined in Database.PostgreSQL.Simple.ToField toField :: Binary ByteString -> Action # |
Wrap a list for use as a PostgreSQL array.
PGArray | |
|
Instances
Functor PGArray | |
Eq a => Eq (PGArray a) | |
Ord a => Ord (PGArray a) | |
Defined in Database.PostgreSQL.Simple.Types | |
Read a => Read (PGArray a) | |
Show a => Show (PGArray a) | |
(FromField a, Typeable a) => FromField (PGArray a) | any postgresql array whose elements are compatible with type |
Defined in Database.PostgreSQL.Simple.FromField fromField :: FieldParser (PGArray a) # | |
ToField a => ToField (PGArray a) | |
Defined in Database.PostgreSQL.Simple.ToField |
Instances
Eq Schema Source # | |
Data Schema Source # | |
Defined in Traction.Sql gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Schema -> c Schema # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Schema # toConstr :: Schema -> Constr # dataTypeOf :: Schema -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Schema) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Schema) # gmapT :: (forall b. Data b => b -> b) -> Schema -> Schema # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Schema -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Schema -> r # gmapQ :: (forall d. Data d => d -> u) -> Schema -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Schema -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Schema -> m Schema # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Schema -> m Schema # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Schema -> m Schema # | |
Show Schema Source # | |
ToField Schema Source # | |
Defined in Traction.Sql |
Instances
Eq Savepoint Source # | |
Data Savepoint Source # | |
Defined in Traction.Sql gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Savepoint -> c Savepoint # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Savepoint # toConstr :: Savepoint -> Constr # dataTypeOf :: Savepoint -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Savepoint) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Savepoint) # gmapT :: (forall b. Data b => b -> b) -> Savepoint -> Savepoint # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Savepoint -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Savepoint -> r # gmapQ :: (forall d. Data d => d -> u) -> Savepoint -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Savepoint -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Savepoint -> m Savepoint # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Savepoint -> m Savepoint # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Savepoint -> m Savepoint # | |
Show Savepoint Source # | |
ToField Savepoint Source # | |
Defined in Traction.Sql |
createSavepoint :: Savepoint -> Db () Source #
releaseSavepoint :: Savepoint -> Db () Source #
rollbackSavepoint :: Savepoint -> Db () Source #
isDuplicate :: Unique a -> Bool Source #