Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
persistent Database.Persist.Class.PersistUnique 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 | +----+------+-----+
-
persistent Database.Persist.Class.PersistUnique Retrieve a record from the database using the given unique keys. It will attempt to find a matching record for each Unique in the list, and returns the first one that has a match. Returns Nothing if you provide an empty list ('[]') or if no value matches in the database.
getEntityComments :: EntityDef -> Maybe Textpersistent Database.Persist.EntityDef No documentation available.
getEntityDBName :: EntityDef -> EntityNameDBpersistent Database.Persist.EntityDef Return the database name for the given entity.
getEntityExtra :: EntityDef -> Map Text [[Text]]persistent Database.Persist.EntityDef No documentation available.
getEntityFields :: EntityDef -> [FieldDef]persistent Database.Persist.EntityDef Retrieve the list of FieldDef that makes up the fields of the entity. This does not return the fields for an Id column or an implicit id. It will return the key columns if you used the Primary syntax for defining the primary key. This does not return fields that are marked SafeToRemove or MigrationOnly - so it only returns fields that are represented in the Haskell type. If you need those fields, use getEntityFieldsDatabase.
getEntityFieldsDatabase :: EntityDef -> [FieldDef]persistent Database.Persist.EntityDef This returns all of the FieldDef defined for the EntityDef, including those fields that are marked as MigrationOnly (and therefore only present in the database) or SafeToRemove (and a migration will drop the column if it exists in the database). For all the fields that are present on the Haskell-type, see getEntityFields.
getEntityForeignDefs :: EntityDef -> [ForeignDef]persistent Database.Persist.EntityDef No documentation available.
getEntityHaskellName :: EntityDef -> EntityNameHSpersistent Database.Persist.EntityDef Retrieve the Haskell name of the given entity.
getEntityId :: EntityDef -> EntityIdDefpersistent Database.Persist.EntityDef No documentation available.