Hoogle Search
Within LTS Haskell 23.19 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
persistent Database.Persist.Class Get a record by identifier, if available.
Example usage
With schema-1 and dataset-1,getSpj :: MonadIO m => ReaderT SqlBackend m (Maybe User) getSpj = get spjId
mspj <- getSpj
The above query when applied on dataset-1, will get this:+------+-----+ | name | age | +------+-----+ | SPJ | 40 | +------+-----+
-
persistent Database.Persist.Class.PersistStore Get a record by identifier, if available.
Example usage
With schema-1 and dataset-1,getSpj :: MonadIO m => ReaderT SqlBackend m (Maybe User) getSpj = get spjId
mspj <- getSpj
The above query when applied on dataset-1, will get this:+------+-----+ | name | age | +------+-----+ | SPJ | 40 | +------+-----+
-
persistent-mtl Database.Persist.Monad.Shim The lifted version of get
-
persistent-mtl Database.Persist.Sql.Shim The lifted version of get
-
persistent-redis Database.Persist.Redis Get a record by identifier, if available.
Example usage
With schema-1 and dataset-1,getSpj :: MonadIO m => ReaderT SqlBackend m (Maybe User) getSpj = get spjId
mspj <- getSpj
The above query when applied on dataset-1, will get this:+------+-----+ | name | age | +------+-----+ | SPJ | 40 | +------+-----+
-
persistent-mtl Database.Persist.Monad.SqlQueryRep Constructor corresponding to get
-
persistent-mtl Database.Persist.Monad.TestUtils Constructor corresponding to get
getPersistMap :: PersistValue -> Either Text [(Text, PersistValue)]persistent Database.Persist FIXME Add documentation to that.
-
persistent Database.Persist.Class Get a record by unique key, if available. Returns also the identifier.
Example usage
With schema-1 and dataset-1:getBySpjName :: MonadIO m => ReaderT SqlBackend m (Maybe (Entity User)) getBySpjName = getBy $ UniqueUserName "SPJ"
mSpjEnt <- getBySpjName
The above query when applied on dataset-1, will get this entity:+----+------+-----+ | id | name | age | +----+------+-----+ | 1 | SPJ | 40 | +----+------+-----+
-
persistent Database.Persist.Class A modification of getBy, which takes the PersistEntity itself instead of a Unique record. Returns a record matching one of the unique keys. This function makes the most sense on entities with a single Unique constructor.
Example usage
With schema-1 and dataset-1, getBySpjValue :: MonadIO m => ReaderT SqlBackend m (Maybe (Entity User)) getBySpjValue = getByValue $ User SPJ 999mSpjEnt <- getBySpjValue
The above query when applied on dataset-1, will get this record:+----+------+-----+ | id | name | age | +----+------+-----+ | 1 | SPJ | 40 | +----+------+-----+
Page 1 of many | Next