Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

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

  1. FieldAttrMaybe :: FieldAttr

    esqueleto Database.Esqueleto.Legacy

    The Maybe keyword goes after the type. This indicates that the column is nullable, and the generated Haskell code will have a Maybe type for it. Example:

    User
    name Text Maybe
    

  2. fromBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key (BaseEnt ent)))) -> SqlExpr (Value (Maybe (Key ent)))

    esqueleto Database.Esqueleto.Legacy

    As fromBaseId, but works on Maybe keys.

  3. isFieldMaybe :: FieldDef -> Bool

    esqueleto Database.Esqueleto.Legacy

    Check if the field is `Maybe a`

  4. subSelectMaybe :: PersistField a => SqlQuery (SqlExpr (Value (Maybe a))) -> SqlExpr (Value (Maybe a))

    esqueleto Database.Esqueleto.Legacy

    Execute a subquery SELECT in a SqlExpr. This function is a shorthand for the common joinV . subSelect idiom, where you are calling subSelect on an expression that would be Maybe already. As an example, you would use this function when calling sum_ or max_, which have Maybe in the result type (for a 0 row query).

  5. toBaseIdMaybe :: ToBaseId ent => SqlExpr (Value (Maybe (Key ent))) -> SqlExpr (Value (Maybe (Key (BaseEnt ent))))

    esqueleto Database.Esqueleto.Legacy

    Like toBaseId, but works on Maybe keys.

  6. upsertMaybe :: forall (m :: Type -> Type) record . (MonadIO m, PersistEntity record, OnlyOneUniqueKey record, PersistRecordBackend record SqlBackend, IsPersistBackend (PersistEntityBackend record)) => record -> [SqlExpr (Entity record) -> SqlExpr Update] -> ReaderT SqlBackend m (Maybe (Entity record))

    esqueleto Database.Esqueleto.PostgreSQL

    Like upsert, but permits an empty list of updates to be performed. If no updates are provided and the record already was present in the database, then this will return Nothing. If you want to fetch the record out of the database, you can write:

    mresult <- upsertMaybe record []
    case mresult of
    Nothing ->
    getBy (onlyUniqueP record)
    Just res ->
    pure (Just res)
    

  7. upsertMaybeBy :: forall (m :: Type -> Type) record . (MonadIO m, PersistEntity record, IsPersistBackend (PersistEntityBackend record)) => Unique record -> record -> [SqlExpr (Entity record) -> SqlExpr Update] -> ReaderT SqlBackend m (Maybe (Entity record))

    esqueleto Database.Esqueleto.PostgreSQL

    Attempt to insert a record into the database. If the record already exists for the given Unique record, then a list of updates will be performed. If you provide an empty list of updates, then this function will return Nothing if the record already exists in the database.

  8. sqlMaybeFieldModifier :: DeriveEsqueletoRecordSettings -> String -> String

    esqueleto Database.Esqueleto.Record

    Function applied to the Haskell record's field names to produce the ToMaybe SQL record's field names.

  9. sqlMaybeNameModifier :: DeriveEsqueletoRecordSettings -> String -> String

    esqueleto Database.Esqueleto.Record

    Function applied to the Haskell record's type name and constructor name to produce the ToMaybe record's type name and constructor name.

  10. takeMaybeColumns :: SqlSelect a (ToMaybeT b) => StateT [PersistValue] (Either Text) (ToMaybeT b)

    esqueleto Database.Esqueleto.Record

    Statefully parse some number of columns from a list of PersistValues, where the number of columns to parse is determined by sqlSelectColCount for a. This is used to implement sqlSelectProcessRow for records created with deriveEsqueletoRecord.

Page 187 of many | Previous | Next