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.

  1. toPersistValueEnum :: Enum a => a -> PersistValue

    persistent 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
    

  2. toPersistValueJSON :: ToJSON a => a -> PersistValue

    persistent 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
    

  3. fromPersistValue :: PersistField a => PersistValue -> Either Text a

    persistent Database.Persist.Class.PersistField

    No documentation available.

  4. getPersistMap :: PersistValue -> Either Text [(Text, PersistValue)]

    persistent Database.Persist.Class.PersistField

    FIXME Add documentation to that.

  5. toPersistValue :: PersistField a => a -> PersistValue

    persistent Database.Persist.Class.PersistField

    No documentation available.

  6. class HasPersistBackend backend

    persistent 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

  7. class HasPersistBackend backend => IsPersistBackend backend

    persistent 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.

  8. liftPersist :: (MonadIO m, MonadReader backend m) => ReaderT backend IO b -> m b

    persistent Database.Persist.Class.PersistStore

    No documentation available.

  9. mkPersistBackend :: IsPersistBackend backend => BaseBackend backend -> backend

    persistent 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.

  10. fromPersistValueText :: PersistValue -> Either Text Text

    persistent Database.Persist.PersistValue

    No documentation available.

Page 43 of many | Previous | Next