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.
-
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 999mSpjEnt <- getBySpjValue
The above query when applied on dataset-1, will get this record:+----+------+-----+ | id | name | age | +----+------+-----+ | 1 | SPJ | 40 | +----+------+-----+
keyFromValues :: PersistEntity record => [PersistValue] -> Either Text (Key record)esqueleto Database.Esqueleto.Experimental A lower-level key operation.
keyToValues :: PersistEntity record => Key record -> [PersistValue]esqueleto Database.Esqueleto.Experimental A lower-level key operation.
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
keyValueEntityToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Valueesqueleto 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
persistUniqueToValues :: PersistEntity record => Unique record -> [PersistValue]esqueleto Database.Esqueleto.Experimental A lower level operation.
toPersistValue :: PersistField a => a -> PersistValueesqueleto Database.Esqueleto.Experimental No documentation available.
toPersistValueJSON :: ToJSON a => a -> PersistValueesqueleto 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
-
esqueleto Database.Esqueleto.Experimental No documentation available.
AliasedValueErr :: UnexpectedValueError -> EsqueletoErroresqueleto Database.Esqueleto.Internal.Internal No documentation available.