traction-0.4.0: Tools for postgresql-simple.

Safe HaskellNone
LanguageHaskell2010

Traction.Sql

Synopsis

Documentation

newtype Only a #

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) -> {- ... -}

Constructors

Only 

Fields

Instances
Functor Only 
Instance details

Defined in Data.Tuple.Only

Methods

fmap :: (a -> b) -> Only a -> Only b #

(<$) :: a -> Only b -> Only a #

Eq a => Eq (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

(==) :: Only a -> Only a -> Bool #

(/=) :: Only a -> Only a -> Bool #

Data a => Data (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

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) 
Instance details

Defined in Data.Tuple.Only

Methods

compare :: Only a -> Only a -> Ordering #

(<) :: Only a -> Only a -> Bool #

(<=) :: Only a -> Only a -> Bool #

(>) :: Only a -> Only a -> Bool #

(>=) :: Only a -> Only a -> Bool #

max :: Only a -> Only a -> Only a #

min :: Only a -> Only a -> Only a #

Read a => Read (Only a) 
Instance details

Defined in Data.Tuple.Only

Show a => Show (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

showsPrec :: Int -> Only a -> ShowS #

show :: Only a -> String #

showList :: [Only a] -> ShowS #

Generic (Only a) 
Instance details

Defined in Data.Tuple.Only

Associated Types

type Rep (Only a) :: Type -> Type #

Methods

from :: Only a -> Rep (Only a) x #

to :: Rep (Only a) x -> Only a #

NFData a => NFData (Only a) 
Instance details

Defined in Data.Tuple.Only

Methods

rnf :: Only a -> () #

FromField a => FromRow (Maybe (Only a)) 
Instance details

Defined in Database.PostgreSQL.Simple.FromRow

Methods

fromRow :: RowParser (Maybe (Only a)) #

FromField a => FromRow (Only a) 
Instance details

Defined in Database.PostgreSQL.Simple.FromRow

Methods

fromRow :: RowParser (Only a) #

ToField a => ToRow (Only a) 
Instance details

Defined in Database.PostgreSQL.Simple.ToRow

Methods

toRow :: Only a -> [Action] #

type Rep (Only a) 
Instance details

Defined in Data.Tuple.Only

type Rep (Only a) = D1 (MetaData "Only" "Data.Tuple.Only" "Only-0.1-4eYnxvcrr7tEbYgCvIkHLb" True) (C1 (MetaCons "Only" PrefixI True) (S1 (MetaSel (Just "fromOnly") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

newtype Binary a #

Wrap binary data for use as a bytea value.

Constructors

Binary 

Fields

Instances
Functor Binary 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

fmap :: (a -> b) -> Binary a -> Binary b #

(<$) :: a -> Binary b -> Binary a #

Eq a => Eq (Binary a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

(==) :: Binary a -> Binary a -> Bool #

(/=) :: Binary a -> Binary a -> Bool #

Ord a => Ord (Binary a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

compare :: Binary a -> Binary a -> Ordering #

(<) :: Binary a -> Binary a -> Bool #

(<=) :: Binary a -> Binary a -> Bool #

(>) :: Binary a -> Binary a -> Bool #

(>=) :: Binary a -> Binary a -> Bool #

max :: Binary a -> Binary a -> Binary a #

min :: Binary a -> Binary a -> Binary a #

Read a => Read (Binary a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Show a => Show (Binary a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

showsPrec :: Int -> Binary a -> ShowS #

show :: Binary a -> String #

showList :: [Binary a] -> ShowS #

FromField (Binary ByteString)

bytea

Instance details

Defined in Database.PostgreSQL.Simple.FromField

FromField (Binary ByteString)

bytea

Instance details

Defined in Database.PostgreSQL.Simple.FromField

ToField (Binary ByteString) 
Instance details

Defined in Database.PostgreSQL.Simple.ToField

ToField (Binary ByteString) 
Instance details

Defined in Database.PostgreSQL.Simple.ToField

newtype PGArray a #

Wrap a list for use as a PostgreSQL array.

Constructors

PGArray 

Fields

Instances
Functor PGArray 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

fmap :: (a -> b) -> PGArray a -> PGArray b #

(<$) :: a -> PGArray b -> PGArray a #

Eq a => Eq (PGArray a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

(==) :: PGArray a -> PGArray a -> Bool #

(/=) :: PGArray a -> PGArray a -> Bool #

Ord a => Ord (PGArray a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

compare :: PGArray a -> PGArray a -> Ordering #

(<) :: PGArray a -> PGArray a -> Bool #

(<=) :: PGArray a -> PGArray a -> Bool #

(>) :: PGArray a -> PGArray a -> Bool #

(>=) :: PGArray a -> PGArray a -> Bool #

max :: PGArray a -> PGArray a -> PGArray a #

min :: PGArray a -> PGArray a -> PGArray a #

Read a => Read (PGArray a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Show a => Show (PGArray a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

showsPrec :: Int -> PGArray a -> ShowS #

show :: PGArray a -> String #

showList :: [PGArray a] -> ShowS #

(FromField a, Typeable a) => FromField (PGArray a)

any postgresql array whose elements are compatible with type a

Instance details

Defined in Database.PostgreSQL.Simple.FromField

ToField a => ToField (PGArray a) 
Instance details

Defined in Database.PostgreSQL.Simple.ToField

Methods

toField :: PGArray a -> Action #

mandatory :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m b Source #

mandatory_ :: (MonadDb m, FromRow a) => Query -> m a Source #

unique :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m (Maybe b) Source #

unique_ :: (MonadDb m, FromRow a) => Query -> m (Maybe a) Source #

query :: (MonadDb m, ToRow a, FromRow b) => Query -> a -> m [b] Source #

query_ :: (MonadDb m, FromRow a) => Query -> m [a] Source #

execute :: (MonadDb m, ToRow a) => Query -> a -> m Int64 Source #

explain :: (MonadDb m, ToRow a) => Query -> a -> m Text Source #

value :: Functor f => f (Only a) -> f a Source #

valueWith :: Functor f => (a -> b) -> f (Only a) -> f b Source #

values :: (Functor f, Functor g) => g (f (Only a)) -> g (f a) Source #

valuesWith :: (Functor f, Functor g) => (a -> b) -> g (f (Only a)) -> g (f b) Source #

newtype Schema Source #

Constructors

Schema 

Fields

Instances
Eq Schema Source # 
Instance details

Defined in Traction.Sql

Methods

(==) :: Schema -> Schema -> Bool #

(/=) :: Schema -> Schema -> Bool #

Data Schema Source # 
Instance details

Defined in Traction.Sql

Methods

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 # 
Instance details

Defined in Traction.Sql

ToField Schema Source # 
Instance details

Defined in Traction.Sql

Methods

toField :: Schema -> Action #

newtype Savepoint Source #

Constructors

Savepoint 
Instances
Eq Savepoint Source # 
Instance details

Defined in Traction.Sql

Data Savepoint Source # 
Instance details

Defined in Traction.Sql

Methods

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 # 
Instance details

Defined in Traction.Sql

ToField Savepoint Source # 
Instance details

Defined in Traction.Sql

Methods

toField :: Savepoint -> Action #

data Unique a Source #

Constructors

Unique a 
Duplicate Query SqlError 
Instances
Functor Unique Source # 
Instance details

Defined in Traction.Sql

Methods

fmap :: (a -> b) -> Unique a -> Unique b #

(<$) :: a -> Unique b -> Unique a #

Show a => Show (Unique a) Source # 
Instance details

Defined in Traction.Sql

Methods

showsPrec :: Int -> Unique a -> ShowS #

show :: Unique a -> String #

showList :: [Unique a] -> ShowS #