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

Safe HaskellNone
LanguageHaskell2010

Database.Seakale.Types

Documentation

class Monad m => MonadSeakaleBase backend m | m -> backend where Source #

Minimal complete definition

getBackend, throwSeakaleError, catchSeakaleError

Methods

getBackend :: m backend Source #

throwSeakaleError :: SeakaleError -> m a Source #

catchSeakaleError :: m a -> (SeakaleError -> m a) -> m a Source #

Instances

(Monoid w, MonadSeakaleBase backend m) => MonadSeakaleBase backend (WriterT w m) Source # 
MonadSeakaleBase backend m => MonadSeakaleBase backend (StateT s m) Source # 
MonadSeakaleBase backend m => MonadSeakaleBase backend (ExceptT e m) Source # 
Monad m => MonadSeakaleBase backend (FreeT (RequestF backend) m) Source # 

Methods

getBackend :: FreeT (RequestF backend) m backend Source #

throwSeakaleError :: SeakaleError -> FreeT (RequestF backend) m a Source #

catchSeakaleError :: FreeT (RequestF backend) m a -> (SeakaleError -> FreeT (RequestF backend) m a) -> FreeT (RequestF backend) m a Source #

MonadSeakaleBase backend m => MonadSeakaleBase backend (FreeT (StoreF backend) m) Source # 

Methods

getBackend :: FreeT (StoreF backend) m backend Source #

throwSeakaleError :: SeakaleError -> FreeT (StoreF backend) m a Source #

catchSeakaleError :: FreeT (StoreF backend) m a -> (SeakaleError -> FreeT (StoreF backend) m a) -> FreeT (StoreF backend) m a Source #

Monad m => MonadSeakaleBase backend (FreeT (SelectF backend) m) Source # 

Methods

getBackend :: FreeT (SelectF backend) m backend Source #

throwSeakaleError :: SeakaleError -> FreeT (SelectF backend) m a Source #

catchSeakaleError :: FreeT (SelectF backend) m a -> (SeakaleError -> FreeT (SelectF backend) m a) -> FreeT (SelectF backend) m a Source #

MonadSeakaleBase backend m => MonadSeakaleBase backend (ReaderT * r m) Source # 

data Nat Source #

Constructors

O 
S Nat 

type Zero = O Source #

type One = S Zero Source #

type Two = S One Source #

type Three = S Two Source #

type Five = S Four Source #

type Six = S Five Source #

type Seven = S Six Source #

type Ten = S Nine Source #

type family (n :: Nat) :+ (m :: Nat) :: Nat Source #

Instances

type O :+ n Source # 
type O :+ n = n
type (S n) :+ m Source # 
type (S n) :+ m = S ((:+) n m)

data Query :: Nat -> * where Source #

Constructors

Plain :: ByteString -> Query n -> Query n 
Hole :: Query n -> Query (S n) 
EmptyQuery :: Query Zero 

qappend :: Query n -> Query m -> Query (n :+ m) Source #

data RepeatQuery :: Nat -> Nat -> Nat -> * where Source #

Constructors

RepeatQuery :: Query k -> Query l -> ByteString -> Query i -> RepeatQuery k l i 

newtype Field backend Source #

Constructors

Field 

Instances

Eq (Field backend) Source # 

Methods

(==) :: Field backend -> Field backend -> Bool #

(/=) :: Field backend -> Field backend -> Bool #

Show (Field backend) Source # 

Methods

showsPrec :: Int -> Field backend -> ShowS #

show :: Field backend -> String #

showList :: [Field backend] -> ShowS #

type Row backend = [Field backend] Source #

class Backend backend where Source #

Minimal complete definition

runQuery, runExecute

Associated Types

type ColumnType backend :: * Source #

type MonadBackend backend (m :: * -> *) :: Constraint Source #

Methods

runQuery :: MonadBackend backend m => backend -> ByteString -> m (Either ByteString ([ColumnInfo backend], [Row backend])) Source #

runExecute :: MonadBackend backend m => backend -> ByteString -> m (Either ByteString Integer) Source #

data ColumnInfo backend Source #

Constructors

ColumnInfo 

Instances

Eq (ColumnType backend) => Eq (ColumnInfo backend) Source # 

Methods

(==) :: ColumnInfo backend -> ColumnInfo backend -> Bool #

(/=) :: ColumnInfo backend -> ColumnInfo backend -> Bool #

Show (ColumnType backend) => Show (ColumnInfo backend) Source # 

Methods

showsPrec :: Int -> ColumnInfo backend -> ShowS #

show :: ColumnInfo backend -> String #

showList :: [ColumnInfo backend] -> ShowS #

data Vector :: Nat -> * -> * where Source #

Constructors

Cons :: a -> Vector n a -> Vector (S n) a 
Nil :: Vector Zero a 

Instances

FromRow backend Zero (Vector Zero a) Source # 

Methods

fromRow :: RowParser backend Zero (Vector Zero a) 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 #

Functor (Vector n) Source # 

Methods

fmap :: (a -> b) -> Vector n a -> Vector n b #

(<$) :: a -> Vector n b -> Vector n a #

NTimes (Vector Zero) Source # 

Methods

ntimes :: a -> Vector Zero a Source #

NTimes (Vector n) => NTimes (Vector (S n)) Source # 

Methods

ntimes :: a -> Vector (S n) a Source #

IsList (Vector Zero a) Source # 

Associated Types

type Item (Vector Zero a) :: * #

Methods

fromList :: [Item (Vector Zero a)] -> Vector Zero a #

fromListN :: Int -> [Item (Vector Zero a)] -> Vector Zero a #

toList :: Vector Zero a -> [Item (Vector Zero a)] #

(IsList (Vector n a), (~) * (Item (Vector n a)) a) => IsList (Vector (S n) a) Source # 

Associated Types

type Item (Vector (S n) a) :: * #

Methods

fromList :: [Item (Vector (S n) a)] -> Vector (S n) a #

fromListN :: Int -> [Item (Vector (S n) a)] -> Vector (S n) a #

toList :: Vector (S n) a -> [Item (Vector (S n) a)] #

Eq a => Eq (Vector n a) Source # 

Methods

(==) :: Vector n a -> Vector n a -> Bool #

(/=) :: Vector n a -> Vector n a -> Bool #

type Item (Vector Zero a) Source # 
type Item (Vector Zero a) = a
type Item (Vector (S n) a) Source # 
type Item (Vector (S n) a) = a

cons :: a -> Vector n a -> Vector (S n) a Source #

(<:>) :: a -> Vector n a -> Vector (S n) a infixr 5 Source #

(<:|) :: a -> a -> Vector Two a infixr 5 Source #

vappend :: Vector n a -> Vector m a -> Vector (n :+ m) a Source #

vzip :: Vector n a -> Vector n b -> Vector n (a, b) Source #

vectorToList :: Vector n a -> [a] Source #

eqVector :: Eq a => Vector n a -> Vector m a -> Bool Source #

class NTimes f where Source #

Minimal complete definition

ntimes

Methods

ntimes :: a -> f a Source #

Instances

NTimes (Vector Zero) Source # 

Methods

ntimes :: a -> Vector Zero a Source #

NTimes (Vector n) => NTimes (Vector (S n)) Source # 

Methods

ntimes :: a -> Vector (S n) a Source #

data Null Source #

Constructors

Null 

Instances

ToRow backend One Null Source # 

Methods

toRow :: backend -> Null -> QueryData One Source #

FromRow backend One Null Source # 

Methods

fromRow :: RowParser backend One Null Source #