Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Entity a = Entity {}
- data Relation backend k l a = Relation {}
- eqRelation :: Relation backend k l a -> Relation backend k l a -> Bool
- newtype RelationName = RelationName {}
- newtype Column = Column {
- unColumn :: ByteString -> ByteString
- class (Typeable backend, Typeable k, Typeable l, Typeable a) => Storable backend k l a | a -> k, a -> l where
- data Condition backend a = Condition (ByteString -> backend -> (Query n, QueryData n))
- eqCondition :: backend -> Condition backend a -> Condition backend a -> Bool
- combineConditions :: ByteString -> Condition backend a -> Condition backend a -> Condition backend a
- buildCondition :: ByteString -> ByteString -> (backend -> Vector n Column) -> (backend -> QueryData n) -> Condition backend a
- buildCondition' :: ByteString -> (backend -> Vector n Column) -> (backend -> Vector n Column) -> Condition backend a
- data Order
- data SelectClauses backend a = SelectClauses {
- selectGroupBy :: backend -> [Column]
- selectOrderBy :: backend -> [(Column, Order)]
- selectLimit :: Maybe Int
- selectOffset :: Maybe Int
- eqSelectClauses :: backend -> SelectClauses backend a -> SelectClauses backend a -> Bool
- buildWhereClause :: Condition backend a -> ByteString -> backend -> ByteString
- buildOnClause :: Condition backend a -> ByteString -> backend -> ByteString
- buildColumnList :: [Column] -> ByteString
- buildRelationName :: RelationName -> ByteString
- buildSelectClauses :: SelectClauses backend a -> backend -> ByteString
- buildSelectRequest :: backend -> Relation backend k l a -> Condition backend a -> SelectClauses backend a -> ByteString
- buildCountRequest :: backend -> Relation backend k l a -> Condition backend a -> ByteString
- data SelectF backend a
- = (Storable backend k l b, FromRow backend (k :+ l) (Entity b)) => Select (Relation backend k l b) (Condition backend b) (SelectClauses backend b) ([Entity b] -> a)
- | Storable backend k l b => Count (Relation backend k l b) (Condition backend b) (Integer -> a)
- | SelectGetBackend (backend -> a)
- | SelectThrowError SeakaleError
- | SelectCatchError a (SeakaleError -> a)
- type SelectT backend = FreeT (SelectF backend)
- type Select backend = SelectT backend Identity
- class MonadSeakaleBase backend m => MonadSelect backend m where
- runSelectT :: Monad m => SelectT backend m a -> RequestT backend m a
- runSelect :: Select backend a -> Request backend a
- data UpdateSetter backend a = UpdateSetter (backend -> Vector n (Column, ByteString))
- eqUpdateSetter :: backend -> UpdateSetter backend a -> UpdateSetter backend a -> Bool
- data StoreF backend a
- type StoreT backend m = FreeT (StoreF backend) (SelectT backend m)
- type Store backend = StoreT backend Identity
- class MonadSelect backend m => MonadStore backend m where
- buildInsertRequest :: Relation backend k l a -> [QueryData l] -> ByteString
- buildSetter :: backend -> UpdateSetter backend a -> ByteString
- buildUpdateRequest :: backend -> Relation backend k l a -> UpdateSetter backend a -> Condition backend a -> ByteString
- buildDeleteRequest :: backend -> Relation backend k l a -> Condition backend a -> ByteString
- runStoreT :: forall backend m a. Monad m => StoreT backend m a -> RequestT backend m a
- runStore :: Store backend a -> Request backend a
Documentation
A value together with its identifier.
(ToRow backend k (EntityID a), ToRow backend l a, (~) Nat ((:+) k l) i) => ToRow backend i (Entity a) Source # | |
(FromRow backend k (EntityID a), FromRow backend l a, (~) Nat ((:+) k l) i) => FromRow backend i (Entity a) Source # | |
(Eq (EntityID a), Eq a) => Eq (Entity a) Source # | |
(Show (EntityID a), Show a) => Show (Entity a) Source # | |
newtype RelationName Source #
Column | |
|
class (Typeable backend, Typeable k, Typeable l, Typeable a) => Storable backend k l a | a -> k, a -> l where Source #
(Storable backend k l a, Storable backend i j b, (~) Nat ((:+) k i) g, (~) Nat ((:+) l j) h, Typeable Nat g, Typeable Nat h) => Storable backend g h (FullJoin a b) Source # | |
(Storable backend k l a, Storable backend i j b, (~) Nat ((:+) k i) g, (~) Nat ((:+) l j) h, Typeable Nat g, Typeable Nat h) => Storable backend g h (InnerJoin a b) Source # | |
(Storable backend k l a, Storable backend i j b, (~) Nat ((:+) k i) g, (~) Nat ((:+) l j) h, Typeable Nat g, Typeable Nat h) => Storable backend g h (RightJoin a b) Source # | |
(Storable backend k l a, Storable backend i j b, (~) Nat ((:+) k i) g, (~) Nat ((:+) l j) h, Typeable Nat g, Typeable Nat h) => Storable backend g h (LeftJoin a b) Source # | |
combineConditions :: ByteString -> Condition backend a -> Condition backend a -> Condition backend a Source #
buildCondition :: ByteString -> ByteString -> (backend -> Vector n Column) -> (backend -> QueryData n) -> Condition backend a Source #
buildCondition' :: ByteString -> (backend -> Vector n Column) -> (backend -> Vector n Column) -> Condition backend a Source #
data SelectClauses backend a Source #
SelectClauses | |
|
Monoid (SelectClauses backend a) Source # | |
eqSelectClauses :: backend -> SelectClauses backend a -> SelectClauses backend a -> Bool Source #
buildWhereClause :: Condition backend a -> ByteString -> backend -> ByteString Source #
buildOnClause :: Condition backend a -> ByteString -> backend -> ByteString Source #
buildColumnList :: [Column] -> ByteString Source #
buildSelectClauses :: SelectClauses backend a -> backend -> ByteString Source #
buildSelectRequest :: backend -> Relation backend k l a -> Condition backend a -> SelectClauses backend a -> ByteString Source #
buildCountRequest :: backend -> Relation backend k l a -> Condition backend a -> ByteString Source #
data SelectF backend a Source #
(Storable backend k l b, FromRow backend (k :+ l) (Entity b)) => Select (Relation backend k l b) (Condition backend b) (SelectClauses backend b) ([Entity b] -> a) | |
Storable backend k l b => Count (Relation backend k l b) (Condition backend b) (Integer -> a) | |
SelectGetBackend (backend -> a) | |
SelectThrowError SeakaleError | |
SelectCatchError a (SeakaleError -> a) |
class MonadSeakaleBase backend m => MonadSelect backend m where Source #
select :: (Storable backend k l a, FromRow backend (k :+ l) (Entity a)) => Relation backend k l a -> Condition backend a -> SelectClauses backend a -> m [Entity a] Source #
count :: Storable backend k l a => Relation backend k l a -> Condition backend a -> m Integer Source #
(MonadSelect backend m, MonadTrans t, MonadSeakaleBase backend (t m)) => MonadSelect backend (t m) Source # | |
Monad m => MonadSelect backend (RequestT backend m) Source # | |
Monad m => MonadSelect backend (FreeT (SelectF backend) m) Source # | |
data UpdateSetter backend a Source #
UpdateSetter (backend -> Vector n (Column, ByteString)) |
Monoid (UpdateSetter backend a) Source # | |
eqUpdateSetter :: backend -> UpdateSetter backend a -> UpdateSetter backend a -> Bool Source #
data StoreF backend a Source #
(Storable backend k l b, ToRow backend l b, FromRow backend k (EntityID b)) => Insert [b] ([EntityID b] -> a) | |
Storable backend k l b => Update (UpdateSetter backend b) (Condition backend b) (Integer -> a) | |
Storable backend k l b => Delete (Condition backend b) (Integer -> a) |
MonadSeakaleBase backend m => MonadSeakaleBase backend (FreeT (StoreF backend) m) Source # | |
MonadSelect backend m => MonadStore backend (FreeT (StoreF backend) m) Source # | |
Functor (StoreF backend) Source # | |
class MonadSelect backend m => MonadStore backend m where Source #
insert :: (Storable backend k l b, ToRow backend l b, FromRow backend k (EntityID b)) => [b] -> m [EntityID b] Source #
update :: Storable backend k l a => UpdateSetter backend a -> Condition backend a -> m Integer Source #
delete :: Storable backend k l a => Condition backend a -> m Integer Source #
(MonadStore backend m, MonadTrans t, MonadSeakaleBase backend (t m)) => MonadStore backend (t m) Source # | |
Monad m => MonadStore backend (RequestT backend m) Source # | |
MonadSelect backend m => MonadStore backend (FreeT (StoreF backend) m) Source # | |
buildInsertRequest :: Relation backend k l a -> [QueryData l] -> ByteString Source #
buildSetter :: backend -> UpdateSetter backend a -> ByteString Source #
buildUpdateRequest :: backend -> Relation backend k l a -> UpdateSetter backend a -> Condition backend a -> ByteString Source #
buildDeleteRequest :: backend -> Relation backend k l a -> Condition backend a -> ByteString Source #