beam-core-0.9.2.1: Type-safe, feature-complete SQL query and manipulation interface for Haskell
Safe Haskell None
Language Haskell2010

Database.Beam.Backend.SQL.BeamExtensions

Description

Some functionality is useful enough to be provided across backends, but is not standardized. For example, many RDBMS systems provide ways of fetching auto-incrementing or defaulting fields on INSERT or UPDATE.

Beam provides type classes that some backends instantiate that provide this support. This uses direct means on sufficiently advanced backends and is emulated on others.

Synopsis

Documentation

class MonadBeam be m => MonadBeamInsertReturning be m | m -> be where Source #

MonadBeam s that support returning the newly created rows of an INSERT statement. Useful for discovering the real value of a defaulted value.

Instances

Instances details
( MonadBeamInsertReturning be m, Monoid r) => MonadBeamInsertReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamInsertReturning be m, Monoid r) => MonadBeamInsertReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamInsertReturning be m => MonadBeamInsertReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamInsertReturning be m => MonadBeamInsertReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamInsertReturning be m => MonadBeamInsertReturning be ( ReaderT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamInsertReturning be m => MonadBeamInsertReturning be ( ExceptT e m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamInsertReturning be m => MonadBeamInsertReturning be ( ContT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamInsertReturning be m, Monoid w) => MonadBeamInsertReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamInsertReturning be m, Monoid w) => MonadBeamInsertReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

class MonadBeam be m => MonadBeamUpdateReturning be m | m -> be where Source #

MonadBeam s that support returning the updated rows of an UPDATE statement. Useful for discovering the new values of the updated rows.

Instances

Instances details
( MonadBeamUpdateReturning be m, Monoid r) => MonadBeamUpdateReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamUpdateReturning be m, Monoid r) => MonadBeamUpdateReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamUpdateReturning be m => MonadBeamUpdateReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamUpdateReturning be m => MonadBeamUpdateReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamUpdateReturning be m => MonadBeamUpdateReturning be ( ReaderT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamUpdateReturning be m => MonadBeamUpdateReturning be ( ExceptT e m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamUpdateReturning be m => MonadBeamUpdateReturning be ( ContT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamUpdateReturning be m, Monoid w) => MonadBeamUpdateReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamUpdateReturning be m, Monoid w) => MonadBeamUpdateReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

class MonadBeam be m => MonadBeamDeleteReturning be m | m -> be where Source #

MonadBeam s that suppert returning rows that will be deleted by the given DELETE statement. Useful for deallocating resources based on the value of deleted rows.

Instances

Instances details
( MonadBeamDeleteReturning be m, Monoid r) => MonadBeamDeleteReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamDeleteReturning be m, Monoid r) => MonadBeamDeleteReturning be ( WriterT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamDeleteReturning be m => MonadBeamDeleteReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamDeleteReturning be m => MonadBeamDeleteReturning be ( StateT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamDeleteReturning be m => MonadBeamDeleteReturning be ( ReaderT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamDeleteReturning be m => MonadBeamDeleteReturning be ( ExceptT e m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

MonadBeamDeleteReturning be m => MonadBeamDeleteReturning be ( ContT r m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamDeleteReturning be m, Monoid w) => MonadBeamDeleteReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

( MonadBeamDeleteReturning be m, Monoid w) => MonadBeamDeleteReturning be ( RWST r w s m) Source #
Instance details

Defined in Database.Beam.Backend.SQL.BeamExtensions

class BeamSqlBackend be => BeamHasInsertOnConflict be where Source #

Associated Types

data SqlConflictTarget be (table :: ( Type -> Type ) -> Type ) :: Type Source #

Specifies the kind of constraint that must be violated for the action to occur

data SqlConflictAction be (table :: ( Type -> Type ) -> Type ) :: Type Source #

What to do when an INSERT statement inserts a row into the table tbl that violates a constraint.

newtype SqlSerial a Source #

Constructors

SqlSerial

Fields

Instances

Instances details
FromBackendRow be x => FromBackendRow be ( SqlSerial x) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Row

HasSqlValueSyntax syntax x => HasSqlValueSyntax syntax ( SqlSerial x) Source #
Instance details

Defined in Database.Beam.Backend.SQL.SQL92

HasSqlQuantifiedEqualityCheck syntax a => HasSqlQuantifiedEqualityCheck syntax ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Query.Ord

HasSqlEqualityCheck be a => HasSqlEqualityCheck be ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Query.Ord

Enum a => Enum ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Eq a => Eq ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Integral a => Integral ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Num a => Num ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Ord a => Ord ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Read a => Read ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Real a => Real ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

Show a => Show ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

ToJSON a => ToJSON ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

FromJSON a => FromJSON ( SqlSerial a) Source #
Instance details

Defined in Database.Beam.Backend.SQL.Types

onConflictUpdateInstead :: forall be table proj. ( BeamHasInsertOnConflict be, Beamable table, ProjectibleWithPredicate AnyType () (InaccessibleQAssignment be) proj) => (table ( Const (InaccessibleQAssignment be)) -> proj) -> SqlConflictAction be table Source #