Safe Haskell | None |
---|
This helper module contains generic versions of PersistBackend functions
Documentation
get :: forall m v. (PersistBackend m, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Key v BackendSpecific -> m (Maybe v)Source
select :: forall m db r v c opts. (SqlDb db, QueryRaw db ~ Snippet db, db ~ PhantomDb m, r ~ RestrictionHolder v c, PersistBackend m, PersistEntity v, EntityConstr v c, HasSelectOptions opts db r) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Utf8 -> opts -> m [v]Source
selectAll :: forall m v. (PersistBackend m, PersistEntity v) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> m [(AutoKey v, v)]Source
:: forall m v u . (PersistBackend m, PersistEntity v, IsUniqueKey (Key v (Unique u))) | |
=> RenderConfig | |
-> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) | function to run query |
-> Key v (Unique u) | |
-> m (Maybe v) |
project :: forall m db r v c p opts a'. (SqlDb db, QueryRaw db ~ Snippet db, db ~ PhantomDb m, r ~ RestrictionHolder v c, PersistBackend m, PersistEntity v, EntityConstr v c, Projection p db r a', HasSelectOptions opts db r) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Utf8 -> p -> opts -> m [a']Source
count :: forall m db r v c. (SqlDb db, QueryRaw db ~ Snippet db, db ~ PhantomDb m, r ~ RestrictionHolder v c, PersistBackend m, PersistEntity v, EntityConstr v c) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Cond db r -> m IntSource
replace :: forall m db r v. (PersistBackend m, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> (Utf8 -> [PersistValue] -> m ()) -> (Bool -> Utf8 -> ConstructorDef -> [PersistValue] -> RenderS db r) -> Key v BackendSpecific -> v -> m ()Source
:: forall m v u . (PersistBackend m, PersistEntity v, IsUniqueKey (Key v (Unique u))) | |
=> RenderConfig | |
-> (Utf8 -> [PersistValue] -> m ()) | function to execute query |
-> u (UniqueMarker v) | |
-> v | |
-> m () |
update :: forall m db r v c. (SqlDb db, QueryRaw db ~ Snippet db, db ~ PhantomDb m, r ~ RestrictionHolder v c, PersistBackend m, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> m ()) -> [Update db r] -> Cond db r -> m ()Source
delete :: forall m db r v c. (SqlDb db, QueryRaw db ~ Snippet db, db ~ PhantomDb m, r ~ RestrictionHolder v c, PersistBackend m, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> m ()) -> Cond db r -> m ()Source
deleteBy :: forall m v. (PersistBackend m, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> m ()) -> Key v BackendSpecific -> m ()Source
deleteAll :: forall m v. (PersistBackend m, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> m ()) -> v -> m ()Source
:: forall m v . (PersistBackend m, PersistEntity v) | |
=> RenderConfig | |
-> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) | function to run query |
-> Bool | allow multiple duplication of uniques with nulls |
-> v | |
-> m (Either (AutoKey v) (AutoKey v)) |
countAll :: forall m v. (PersistBackend m, PersistEntity v) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> v -> m IntSource
insertBy :: forall m v u. (PersistBackend m, PersistEntity v, IsUniqueKey (Key v (Unique u))) => RenderConfig -> (forall a. Utf8 -> [PersistValue] -> (RowPopper m -> m a) -> m a) -> Bool -> u (UniqueMarker v) -> v -> m (Either (AutoKey v) (AutoKey v))Source