HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulepersistent-2.14.6.3Haskell2010

Database.Persist.Sql.Types.Internal

Breaking changes to this module are not reflected in the major version number. Prefer to import from Database.Persist.Sql instead. If you neeed something from this module, please file an issue on GitHub.

  • 13 types
  • 2 classes
  • 4 values
classclass HasPersistBackend backend where
#

Class which allows the plucking of a BaseBackend backend from some larger type. For example, instance HasPersistBackend (SqlReadBackend, Int) where type BaseBackend (SqlReadBackend, Int) = SqlBackend persistBackend = unSqlReadBackend . fst

Associated types

Methods

Instances4HasPersistBackend
classclass HasPersistBackend backend => IsPersistBackend backend where
#

Class which witnesses that backend is essentially the same as BaseBackend backend. That is, they're isomorphic and backend is just some wrapper over BaseBackend backend.

Methods

  • mkPersistBackend :: BaseBackend backend -> backend

    This function is how we actually construct and tag a backend as having read or write capabilities. It should be used carefully and only when actually constructing a backend. Careless use allows us to accidentally run a write query against a read-only database.

Instances3IsPersistBackend
newtypenewtype SqlReadBackend
#

An SQL backend which can only handle read queries

The constructor was exposed in 2.10.0.

Instances27PersistQueryRead, HasPersistBackend, IsPersistBackend, PersistCore, PersistStoreRead, PersistUniqueRead, …
newtypenewtype SqlWriteBackend
#

An SQL backend which can handle read or write queries

The constructor was exposed in 2.10.0

Instances30PersistQueryRead, PersistQueryWrite, HasPersistBackend, IsPersistBackend, PersistCore, PersistStoreRead, …
datadata IsolationLevel
#

Please refer to the documentation for the database in question for a full overview of the semantics of the varying isloation levels

Instances5Bounded, Enum, Eq, Ord, Show
  • Bounded IsolationLevelDefined in persistent-2.14.6.3 · Database.Persist.SqlBackend.Internal.IsolationLevel
  • Enum IsolationLevelDefined in persistent-2.14.6.3 · Database.Persist.SqlBackend.Internal.IsolationLevel
  • Eq IsolationLevelDefined in persistent-2.14.6.3 · Database.Persist.SqlBackend.Internal.IsolationLevel
  • Ord IsolationLevelDefined in persistent-2.14.6.3 · Database.Persist.SqlBackend.Internal.IsolationLevel
  • Show IsolationLevelDefined in persistent-2.14.6.3 · Database.Persist.SqlBackend.Internal.IsolationLevel
datadata SqlBackend
#

A SqlBackend represents a handle or connection to a database. It contains functions and values that allow databases to have more optimized implementations, as well as references that benefit performance and sharing.

Instead of using the SqlBackend constructor directly, use the mkSqlBackend function.

A SqlBackend is *not* thread-safe. You should not assume that a SqlBackend can be shared among threads and run concurrent queries. This *will* result in problems. Instead, you should create a Pool SqlBackend, known as a ConnectionPool, and pass that around in multi-threaded applications.

To run actions in the persistent library, you should use the runSqlConn function. If you're using a multithreaded application, use the runSqlPool function.

Constructors

Instances32PersistQueryRead, PersistQueryWrite, HasPersistBackend, IsPersistBackend, PersistCore, PersistStoreRead, …