seakale-0.1.0.0: Pure SQL layer on top of other libraries

Safe HaskellNone
LanguageHaskell2010

Database.Seakale.FromRow

Synopsis

Documentation

data RowParser backend :: Nat -> * -> * Source #

A pseudo-monad in which parsing of rows is done. Because it is counting the number of fields consumed, it can't be made an instance of Monad.

Instances

Functor (RowParser backend n) Source # 

Methods

fmap :: (a -> b) -> RowParser backend n a -> RowParser backend n b #

(<$) :: a -> RowParser backend n b -> RowParser backend n a #

pmap :: (a -> b) -> RowParser backend n a -> RowParser backend n b Source #

For consistency with the following functions, pmap is given in addition to fmap.

ppure :: a -> RowParser backend Zero a Source #

Equivalent of pure and return.

preturn :: a -> RowParser backend Zero a Source #

Equivalent of pure and return.

papply :: RowParser backend n (a -> b) -> RowParser backend m a -> RowParser backend (n :+ m) b Source #

Equivalent of '(*)'

pbind :: RowParser backend n a -> (a -> RowParser backend m b) -> RowParser backend (n :+ m) b Source #

Equivalent of '(>>=)'.

pfail :: String -> RowParser backend n a Source #

Equivalent of fail from Monad.

pempty :: RowParser backend n a Source #

Equivalent of empty from Alternative.

por :: RowParser backend n a -> RowParser backend n a -> RowParser backend n a Source #

Equivalent of '(|)' from Alternative.

pbackend :: RowParser backend Zero backend Source #

Return the underlying SQL backend.

pconsume :: RowParser backend One (ColumnInfo backend, Field backend) Source #

Return the next column.

class FromRow backend n a | a -> n where Source #

Methods

fromRow :: RowParser backend n a Source #

fromRow :: (Generic a, GFromRow backend ReadCon n (Rep a)) => RowParser backend (n :+ Zero) a Source #

Instances

FromRow backend One Float Source # 

Methods

fromRow :: RowParser backend One Float Source #

FromRow backend One Double Source # 

Methods

fromRow :: RowParser backend One Double Source #

FromRow backend One Integer Source # 

Methods

fromRow :: RowParser backend One Integer Source #

FromRow backend One Int64 Source # 

Methods

fromRow :: RowParser backend One Int64 Source #

FromRow backend One Int32 Source # 

Methods

fromRow :: RowParser backend One Int32 Source #

FromRow backend One Int16 Source # 

Methods

fromRow :: RowParser backend One Int16 Source #

FromRow backend One Int8 Source # 

Methods

fromRow :: RowParser backend One Int8 Source #

FromRow backend One Int Source # 

Methods

fromRow :: RowParser backend One Int Source #

FromRow backend One Text Source # 

Methods

fromRow :: RowParser backend One Text Source #

FromRow backend One Text Source # 

Methods

fromRow :: RowParser backend One Text Source #

FromRow backend One ByteString Source # 
FromRow backend One ByteString Source # 
Backend backend => FromRow backend Zero () Source # 

Methods

fromRow :: RowParser backend Zero () Source #

FromRow backend One Null Source # 

Methods

fromRow :: RowParser backend One Null Source #

(FromRow backend k a, FromRow backend k (Vector k Null)) => FromRow backend k (Maybe a) Source # 

Methods

fromRow :: RowParser backend k (Maybe a) Source #

(FromRow backend k (EntityID a), FromRow backend l a, (~) Nat ((:+) k l) i) => FromRow backend i (Entity a) Source # 

Methods

fromRow :: RowParser backend i (Entity a) Source #

(FromRow backend k (Maybe (EntityID a)), FromRow backend l (Maybe (EntityID b)), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (FullJoin a b)) Source # 

Methods

fromRow :: RowParser backend i (EntityID (FullJoin a b)) Source #

(FromRow backend k (EntityID a), FromRow backend l (EntityID b), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (InnerJoin a b)) Source # 

Methods

fromRow :: RowParser backend i (EntityID (InnerJoin a b)) Source #

(FromRow backend k (Maybe (EntityID a)), FromRow backend l (EntityID b), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (RightJoin a b)) Source # 

Methods

fromRow :: RowParser backend i (EntityID (RightJoin a b)) Source #

(FromRow backend k (EntityID a), FromRow backend l (Maybe (EntityID b)), (~) Nat ((:+) k l) i) => FromRow backend i (EntityID (LeftJoin a b)) Source # 

Methods

fromRow :: RowParser backend i (EntityID (LeftJoin a b)) Source #

(FromRow backend k a, FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (a, b) Source # 

Methods

fromRow :: RowParser backend i (a, b) Source #

FromRow backend Zero (Vector Zero a) Source # 

Methods

fromRow :: RowParser backend Zero (Vector Zero a) Source #

(FromRow backend k (Maybe a), FromRow backend l (Maybe b), (~) Nat ((:+) k l) i) => FromRow backend i (FullJoin a b) Source # 

Methods

fromRow :: RowParser backend i (FullJoin a b) Source #

(FromRow backend k a, FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (InnerJoin a b) Source # 

Methods

fromRow :: RowParser backend i (InnerJoin a b) Source #

(FromRow backend k (Maybe a), FromRow backend l b, (~) Nat ((:+) k l) i) => FromRow backend i (RightJoin a b) Source # 

Methods

fromRow :: RowParser backend i (RightJoin a b) Source #

(FromRow backend k a, FromRow backend l (Maybe b), (~) Nat ((:+) k l) i) => FromRow backend i (LeftJoin a b) Source # 

Methods

fromRow :: RowParser backend i (LeftJoin a b) Source #

(FromRow backend k a, FromRow backend l b, FromRow backend i c, (~) Nat ((:+) ((:+) k l) i) j) => FromRow backend j (a, b, c) Source # 

Methods

fromRow :: RowParser backend j (a, b, c) Source #

(FromRow backend One a, FromRow backend n (Vector n a)) => FromRow backend (S n) (Vector (S n) a) Source # 

Methods

fromRow :: RowParser backend (S n) (Vector (S n) a) Source #

parseRows :: RowParser backend n a -> backend -> [ColumnInfo backend] -> [Row backend] -> Either String [a] Source #

Try to parse rows given a row parser and the SQL backend.

parseRow :: RowParser backend n a -> backend -> [ColumnInfo backend] -> Row backend -> Either String a Source #

maybeParser :: forall backend k a. FromRow backend k (Vector k Null) => RowParser backend k a -> RowParser backend k (Maybe a) Source #