Hoogle Search
Within LTS Haskell 24.6 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
toPersistValueEnum :: Enum a => a -> PersistValuepersistent Database.Persist.Class.PersistEntity Convenience function for getting a free PersistField instance from a type with an Enum instance. The function derivePersistField from the persistent-template package should generally be preferred. However, if you want to ensure that an ORDER BY clause that uses your field will order rows by the data constructor order, this is a better choice. Example usage in combination with fromPersistValueEnum:
data SeverityLevel = Low | Medium | Critical | High deriving (Enum, Bounded) instance PersistField SeverityLevel where fromPersistValue = fromPersistValueEnum toPersistValue = toPersistValueEnum
toPersistValueJSON :: ToJSON a => a -> PersistValuepersistent Database.Persist.Class.PersistEntity Convenience function for getting a free PersistField instance from a type with JSON instances. Example usage in combination with fromPersistValueJSON:
instance PersistField MyData where fromPersistValue = fromPersistValueJSON toPersistValue = toPersistValueJSON
fromPersistValue :: PersistField a => PersistValue -> Either Text apersistent Database.Persist.Class.PersistField No documentation available.
getPersistMap :: PersistValue -> Either Text [(Text, PersistValue)]persistent Database.Persist.Class.PersistField FIXME Add documentation to that.
toPersistValue :: PersistField a => a -> PersistValuepersistent Database.Persist.Class.PersistField No documentation available.
class
HasPersistBackend backendpersistent Database.Persist.Class.PersistStore Class which allows the plucking of a BaseBackend backend from some larger type. For example, instance HasPersistBackend (SqlReadBackend, Int) where type BaseBackend (SqlReadBackend, Int) = SqlBackend persistBackend = unSqlReadBackend . fst
class HasPersistBackend backend =>
IsPersistBackend backendpersistent Database.Persist.Class.PersistStore Class which witnesses that backend is essentially the same as BaseBackend backend. That is, they're isomorphic and backend is just some wrapper over BaseBackend backend.
liftPersist :: (MonadIO m, MonadReader backend m) => ReaderT backend IO b -> m bpersistent Database.Persist.Class.PersistStore No documentation available.
mkPersistBackend :: IsPersistBackend backend => BaseBackend backend -> backendpersistent Database.Persist.Class.PersistStore This function is how we actually construct and tag a backend as having read or write capabilities. It should be used carefully and only when actually constructing a backend. Careless use allows us to accidentally run a write query against a read-only database.
fromPersistValueText :: PersistValue -> Either Text Textpersistent Database.Persist.PersistValue No documentation available.