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.

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

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

  2. getByValueUniques :: forall record backend (m :: Type -> Type) . (MonadIO m, PersistUniqueRead backend, PersistRecordBackend record backend) => [Unique record] -> ReaderT backend m (Maybe (Entity record))

    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.

  3. getEntityComments :: EntityDef -> Maybe Text

    persistent Database.Persist.EntityDef

    No documentation available.

  4. getEntityDBName :: EntityDef -> EntityNameDB

    persistent Database.Persist.EntityDef

    Return the database name for the given entity.

  5. getEntityExtra :: EntityDef -> Map Text [[Text]]

    persistent Database.Persist.EntityDef

    No documentation available.

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

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

  8. getEntityForeignDefs :: EntityDef -> [ForeignDef]

    persistent Database.Persist.EntityDef

    No documentation available.

  9. getEntityHaskellName :: EntityDef -> EntityNameHS

    persistent Database.Persist.EntityDef

    Retrieve the Haskell name of the given entity.

  10. getEntityId :: EntityDef -> EntityIdDef

    persistent Database.Persist.EntityDef

    No documentation available.

Page 3 of many | Previous | Next