Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. getByValue :: forall record (m :: Type -> Type) backend . (MonadIO m, PersistUniqueRead backend, PersistRecordBackend record backend, AtLeastOneUniqueKey record) => record -> ReaderT backend m (Maybe (Entity record))

    esqueleto Database.Esqueleto.Experimental

    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 999
    mSpjEnt <- getBySpjValue
    
    The above query when applied on dataset-1, will get this record:
    +----+------+-----+
    | id | name | age |
    +----+------+-----+
    |  1 | SPJ  |  40 |
    +----+------+-----+
    

  2. keyFromValues :: PersistEntity record => [PersistValue] -> Either Text (Key record)

    esqueleto Database.Esqueleto.Experimental

    A lower-level key operation.

  3. keyToValues :: PersistEntity record => Key record -> [PersistValue]

    esqueleto Database.Esqueleto.Experimental

    A lower-level key operation.

  4. keyValueEntityFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record)

    esqueleto Database.Esqueleto.Experimental

    Predefined parseJSON. The input JSON looks like {"key": 1, "value": {"name": ...}}. The typical usage is:

    instance FromJSON (Entity User) where
    parseJSON = keyValueEntityFromJSON
    

  5. keyValueEntityToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value

    esqueleto Database.Esqueleto.Experimental

    Predefined toJSON. The resulting JSON looks like {"key": 1, "value": {"name": ...}}. The typical usage is:

    instance ToJSON (Entity User) where
    toJSON = keyValueEntityToJSON
    

  6. persistUniqueToValues :: PersistEntity record => Unique record -> [PersistValue]

    esqueleto Database.Esqueleto.Experimental

    A lower level operation.

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

    esqueleto Database.Esqueleto.Experimental

    No documentation available.

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

    esqueleto Database.Esqueleto.Experimental

    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
    

  9. unValue :: Value a -> a

    esqueleto Database.Esqueleto.Experimental

    No documentation available.

  10. AliasedValueErr :: UnexpectedValueError -> EsqueletoError

    esqueleto Database.Esqueleto.Internal.Internal

    No documentation available.

Page 8 of many | Previous | Next