traction-0.0.1

Safe HaskellNone
LanguageHaskell2010

Traction.Sql

Synopsis

Documentation

newtype Only a #

A single-value "collection".

This is useful if you need to supply a single parameter to a SQL query, or extract a single column from a SQL result.

Parameter example:

query c "select x from scores where x > ?" (Only (42::Int))

Result example:

xs <- query_ c "select id from users"
forM_ xs $ \(Only id) -> {- ... -}

Constructors

Only 

Fields

Instances
Functor Only 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

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

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

Eq a => Eq (Only a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

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

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

Ord a => Ord (Only a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

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 Database.PostgreSQL.Simple.Types

Show a => Show (Only a) 
Instance details

Defined in Database.PostgreSQL.Simple.Types

Methods

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

show :: Only a -> String #

showList :: [Only a] -> ShowS #

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] #

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

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 #

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 #