groundhog-0.1.0.2: Type-safe ADT-database mapping library.

Safe HaskellNone

Database.Groundhog.Generic.PersistBackendHelpers

Description

This helper module contains generic versions of PersistBackend functions

Documentation

get :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Key v BackendSpecific -> m (Maybe v)Source

select :: forall m s v c opts. (PersistBackend m, StringLike s, PersistEntity v, Constructor c, HasSelectOptions opts v c) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> s -> (Cond v c -> Maybe (RenderS s)) -> opts -> m [v]Source

selectAll :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> m [(AutoKey v, v)]Source

getBy :: forall m s v u. (PersistBackend m, StringLike s, PersistEntity v, IsUniqueKey (Key v (Unique u))) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Key v (Unique u) -> m (Maybe v)Source

project :: forall m s v c p opts a'. (PersistBackend m, StringLike s, PersistEntity v, Constructor c, Projection p (RestrictionHolder v c) a', HasSelectOptions opts v c) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> s -> (Cond v c -> Maybe (RenderS s)) -> p -> opts -> m [a']Source

count :: forall m s v c. (PersistBackend m, StringLike s, PersistEntity v, Constructor c) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> (Cond v c -> Maybe (RenderS s)) -> Cond v c -> m IntSource

replace :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> (s -> [PersistValue] -> m ()) -> (Bool -> String -> ConstructorDef -> s) -> Key v BackendSpecific -> v -> m ()Source

update :: forall m s v c. (PersistBackend m, StringLike s, PersistEntity v, Constructor c) => (s -> s) -> (s -> [PersistValue] -> m ()) -> (Cond v c -> Maybe (RenderS s)) -> [Update v c] -> Cond v c -> m ()Source

delete :: forall m s v c. (PersistBackend m, StringLike s, PersistEntity v, Constructor c) => (s -> s) -> (s -> [PersistValue] -> m ()) -> (Cond v c -> Maybe (RenderS s)) -> Cond v c -> m ()Source

insertByAll :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> v -> m (Either (AutoKey v) (AutoKey v))Source

deleteByKey :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => (s -> s) -> (s -> [PersistValue] -> m ()) -> Key v BackendSpecific -> m ()Source

countAll :: forall m s v. (PersistBackend m, StringLike s, PersistEntity v) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> v -> m IntSource

insertBy :: forall m s v u. (PersistBackend m, StringLike s, PersistEntity v, IsUniqueKey (Key v (Unique u))) => (s -> s) -> (forall a. s -> [DbType] -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> u (UniqueMarker v) -> v -> m (Either (AutoKey v) (AutoKey v))Source