Safe Haskell | None |
---|---|
Language | Haskell98 |
This helper module contains generic versions of PersistBackend functions
Synopsis
- get :: forall conn v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Key v BackendSpecific -> Action conn (Maybe v)
- select :: forall conn r v c opts. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> opts -> Action conn [v]
- selectAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Action conn [(AutoKey v, v)]
- selectStream :: forall conn r v c opts. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> opts -> Action conn (RowStream v)
- selectAllStream :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Action conn (RowStream (AutoKey v, v))
- getBy :: forall conn v u. (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Key v (Unique u) -> Action conn (Maybe v)
- project :: forall conn r v c p opts a'. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, Projection p a', ProjectionDb p conn, ProjectionRestriction p r, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> p -> opts -> Action conn [a']
- projectStream :: forall conn r v c p opts a'. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, Projection p a', ProjectionDb p conn, ProjectionRestriction p r, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> p -> opts -> Action conn (RowStream a')
- count :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Cond conn r -> Action conn Int
- replace :: forall conn r v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (Utf8 -> [PersistValue] -> Action conn ()) -> (Bool -> Utf8 -> ConstructorDef -> [PersistValue] -> RenderS conn r) -> Key v BackendSpecific -> v -> Action conn ()
- replaceBy :: forall conn v u. (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> u (UniqueMarker v) -> v -> Action conn ()
- update :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> [Update conn r] -> Cond conn r -> Action conn ()
- delete :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> Cond conn r -> Action conn ()
- deleteBy :: forall conn v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> Key v BackendSpecific -> Action conn ()
- deleteAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> v -> Action conn ()
- insertByAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Bool -> v -> Action conn (Either (AutoKey v) (AutoKey v))
- countAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> v -> Action conn Int
- insertBy :: forall conn v u. (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Bool -> u (UniqueMarker v) -> v -> Action conn (Either (AutoKey v) (AutoKey v))
Documentation
get :: forall conn v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Key v BackendSpecific -> Action conn (Maybe v) Source #
select :: forall conn r v c opts. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> opts -> Action conn [v] Source #
selectAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Action conn [(AutoKey v, v)] Source #
selectStream :: forall conn r v c opts. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> opts -> Action conn (RowStream v) Source #
selectAllStream :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Action conn (RowStream (AutoKey v, v)) Source #
It may call the passed function multiple times
:: (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) | |
=> RenderConfig | |
-> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) | function to run query |
-> Key v (Unique u) | |
-> Action conn (Maybe v) |
project :: forall conn r v c p opts a'. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, Projection p a', ProjectionDb p conn, ProjectionRestriction p r, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> p -> opts -> Action conn [a'] Source #
projectStream :: forall conn r v c p opts a'. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c, Projection p a', ProjectionDb p conn, ProjectionRestriction p r, HasSelectOptions opts conn r) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (opts -> RenderS conn r) -> Utf8 -> p -> opts -> Action conn (RowStream a') Source #
count :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Cond conn r -> Action conn Int Source #
replace :: forall conn r v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> (Utf8 -> [PersistValue] -> Action conn ()) -> (Bool -> Utf8 -> ConstructorDef -> [PersistValue] -> RenderS conn r) -> Key v BackendSpecific -> v -> Action conn () Source #
:: (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) | |
=> RenderConfig | |
-> (Utf8 -> [PersistValue] -> Action conn ()) | function to execute query |
-> u (UniqueMarker v) | |
-> v | |
-> Action conn () |
update :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> [Update conn r] -> Cond conn r -> Action conn () Source #
delete :: forall conn r v c. (SqlDb conn, r ~ RestrictionHolder v c, PersistBackendConn conn, PersistEntity v, EntityConstr v c) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> Cond conn r -> Action conn () Source #
deleteBy :: forall conn v. (PersistBackendConn conn, PersistEntity v, PrimitivePersistField (Key v BackendSpecific)) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> Key v BackendSpecific -> Action conn () Source #
deleteAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn ()) -> v -> Action conn () Source #
:: (PersistBackendConn conn, PersistEntity v) | |
=> RenderConfig | |
-> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) | function to run query |
-> Bool | allow multiple duplication of uniques with nulls |
-> v | |
-> Action conn (Either (AutoKey v) (AutoKey v)) |
countAll :: forall conn v. (PersistBackendConn conn, PersistEntity v) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> v -> Action conn Int Source #
insertBy :: forall conn v u. (PersistBackendConn conn, PersistEntity v, IsUniqueKey (Key v (Unique u))) => RenderConfig -> (Utf8 -> [PersistValue] -> Action conn (RowStream [PersistValue])) -> Bool -> u (UniqueMarker v) -> v -> Action conn (Either (AutoKey v) (AutoKey v)) Source #