persistent-2.13.3.5: Type-safe, multi-backend data serialization.
Safe Haskell None
Language Haskell2010

Database.Persist.SqlBackend.Internal

Synopsis

Documentation

data SqlBackend Source #

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

SqlBackend

Fields

Instances

Instances details
PersistStoreWrite SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Methods

insert :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => record -> ReaderT SqlBackend m ( Key record) Source #

insert_ :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => record -> ReaderT SqlBackend m () Source #

insertMany :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => [record] -> ReaderT SqlBackend m [ Key record] Source #

insertMany_ :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => [record] -> ReaderT SqlBackend m () Source #

insertEntityMany :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => [ Entity record] -> ReaderT SqlBackend m () Source #

insertKey :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> record -> ReaderT SqlBackend m () Source #

repsert :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> record -> ReaderT SqlBackend m () Source #

repsertMany :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => [( Key record, record)] -> ReaderT SqlBackend m () Source #

replace :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> record -> ReaderT SqlBackend m () Source #

delete :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> ReaderT SqlBackend m () Source #

update :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> [ Update record] -> ReaderT SqlBackend m () Source #

updateGet :: forall record (m :: Type -> Type ). ( MonadIO m, PersistRecordBackend record SqlBackend ) => Key record -> [ Update record] -> ReaderT SqlBackend m record Source #

PersistStoreRead SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

PersistCore SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

IsPersistBackend SqlBackend Source #
Instance details

Defined in Database.Persist.SqlBackend.Internal

HasPersistBackend SqlBackend Source #
Instance details

Defined in Database.Persist.SqlBackend.Internal

PersistUniqueWrite SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistUnique

PersistUniqueRead SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistUnique

PersistQueryWrite SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistQuery

PersistQueryRead SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistQuery

BackendCompatible SqlBackend SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

BackendCompatible SqlBackend SqlWriteBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

BackendCompatible SqlBackend SqlReadBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Bounded ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Enum ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Eq ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Integral ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Num ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Ord ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Read ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Real ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Show ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

Generic ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

ToJSON ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

FromJSON ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

ToHttpApiData ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

FromHttpApiData ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

PathPiece ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

PersistField ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

PersistFieldSql ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

newtype BackendKey SqlBackend Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type BaseBackend SqlBackend Source #
Instance details

Defined in Database.Persist.SqlBackend.Internal

type Rep ( BackendKey SqlBackend ) Source #
Instance details

Defined in Database.Persist.Sql.Orphan.PersistStore

type Rep ( BackendKey SqlBackend ) = D1 (' MetaData "BackendKey" "Database.Persist.Sql.Orphan.PersistStore" "persistent-2.13.3.5-AzqyBkRvmH2EfWG2peHu6H" ' True ) ( C1 (' MetaCons "SqlBackendKey" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "unSqlBackendKey") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 Int64 )))

mkSqlBackend :: MkSqlBackendArgs -> SqlBackend Source #

A function for creating a value of the SqlBackend type. You should prefer to use this instead of the constructor for SqlBackend , because default values for this will be provided for new fields on the record when new functionality is added.

Since: 2.13.0.0