Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. persistUpperCase :: QuasiQuoter

    persistent Database.Persist.TH

    Apply persistWith to upperCaseSettings.

  2. persistWith :: PersistSettings -> QuasiQuoter

    persistent Database.Persist.TH

    Converts a quasi-quoted syntax into a list of entity definitions, to be used as input to the template haskell generation code (mkPersist).

  3. persistFieldFromEntity :: MkPersistSettings -> UnboundEntityDef -> Q [Dec]

    persistent Database.Persist.TH.Internal

    Produce code similar to the following:

    instance PersistEntity e => PersistField e where
    toPersistValue = entityToPersistValueHelper
    fromPersistValue = entityFromPersistValueHelper ["col1", "col2"]
    sqlType _ = SqlString
    

  4. persistFileWith :: PersistSettings -> FilePath -> Q Exp

    persistent Database.Persist.TH.Internal

    Same as persistWith, but uses an external file instead of a quasiquotation. The recommended file extension is .persistentmodels.

  5. persistLowerCase :: QuasiQuoter

    persistent Database.Persist.TH.Internal

    Apply persistWith to lowerCaseSettings.

  6. persistManyFileWith :: PersistSettings -> [FilePath] -> Q Exp

    persistent Database.Persist.TH.Internal

    Same as persistFileWith, but uses several external files instead of one. Splitting your Persistent definitions into multiple modules can potentially dramatically speed up compile times. The recommended file extension is .persistentmodels.

    Examples

    Split your Persistent definitions into multiple files (models1, models2), then create a new module for each new file and run mkPersist there:
    -- Model1.hs
    share
    [mkPersist sqlSettings]
    $(persistFileWith lowerCaseSettings "models1")
    
    -- Model2.hs
    share
    [mkPersist sqlSettings]
    $(persistFileWith lowerCaseSettings "models2")
    
    Use persistManyFileWith to create your migrations:
    -- Migrate.hs
    mkMigrate "migrateAll"
    $(persistManyFileWith lowerCaseSettings ["models1.persistentmodels","models2.persistentmodels"])
    
    Tip: To get the same import behavior as if you were declaring all your models in one file, import your new files as Name into another file, then export module Name. This approach may be used in the future to reduce memory usage during compilation, but so far we've only seen mild reductions. See persistent#778 and persistent#791 for more details.

  7. persistUpperCase :: QuasiQuoter

    persistent Database.Persist.TH.Internal

    Apply persistWith to upperCaseSettings.

  8. persistWith :: PersistSettings -> QuasiQuoter

    persistent Database.Persist.TH.Internal

    Converts a quasi-quoted syntax into a list of entity definitions, to be used as input to the template haskell generation code (mkPersist).

  9. persistentBackend :: forall backend1 backend2 f . Functor f => (backend1 -> f backend2) -> RawSqlite backend1 -> f (RawSqlite backend2)

    persistent-sqlite Database.Persist.Sqlite

    No documentation available.

  10. persistBackend :: HasPersistBackend backend => backend -> BaseBackend backend

    esqueleto Database.Esqueleto

    No documentation available.

Page 37 of many | Previous | Next