opaleye-0.7.2.0: An SQL-generating DSL targeting PostgreSQL
Safe HaskellNone
LanguageHaskell2010

Opaleye.Internal.Manipulation

Synopsis

Documentation

data Returning a b where Source #

Don't use this internal datatype. Instead you probably want rCount or rReturning.

Constructors

Count :: Returning a Int64 
ReturningExplicit :: FromFields b c -> (a -> b) -> Returning a [c] 

arrangeInsertManyReturning :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> NonEmpty columnsW -> (columnsR -> columnsReturned) -> Maybe OnConflict -> Returning SqlInsert Source #

arrangeInsertManyReturningSql :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> NonEmpty columnsW -> (columnsR -> columnsReturned) -> Maybe OnConflict -> String Source #

arrangeInsertManySql :: Table columnsW columnsR -> NonEmpty columnsW -> Maybe OnConflict -> String Source #

runInsertManyReturningExplicit :: FromFields columnsReturned haskells -> Connection -> Table columnsW columnsR -> [columnsW] -> (columnsR -> columnsReturned) -> Maybe OnConflict -> IO [haskells] Source #

newtype Updater a b Source #

Constructors

Updater (a -> b) 

Instances

Instances details
Profunctor Updater Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

dimap :: (a -> b) -> (c -> d) -> Updater b c -> Updater a d #

lmap :: (a -> b) -> Updater b c -> Updater a c #

rmap :: (b -> c) -> Updater a b -> Updater a c #

(#.) :: forall a b c q. Coercible c b => q b c -> Updater a b -> Updater a c #

(.#) :: forall a b c q. Coercible b a => Updater b c -> q a b -> Updater a c #

ProductProfunctor Updater Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

purePP :: b -> Updater a b #

(****) :: Updater a (b -> c) -> Updater a b -> Updater a c #

empty :: Updater () () #

(***!) :: Updater a b -> Updater a' b' -> Updater (a, a') (b, b') #

Default Updater (Column a) (Maybe (Column a)) Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

def :: Updater (Column a) (Maybe (Column a)) #

Default Updater (Column a) (Column a) Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

def :: Updater (Column a) (Column a) #

Functor (Updater a) Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

fmap :: (a0 -> b) -> Updater a a0 -> Updater a b #

(<$) :: a0 -> Updater a b -> Updater a a0 #

Applicative (Updater a) Source # 
Instance details

Defined in Opaleye.Internal.Manipulation

Methods

pure :: a0 -> Updater a a0 #

(<*>) :: Updater a (a0 -> b) -> Updater a a0 -> Updater a b #

liftA2 :: (a0 -> b -> c) -> Updater a a0 -> Updater a b -> Updater a c #

(*>) :: Updater a a0 -> Updater a b -> Updater a b #

(<*) :: Updater a a0 -> Updater a b -> Updater a a0 #

arrangeDeleteReturning :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> (columnsR -> Column SqlBool) -> (columnsR -> columnsReturned) -> Returning SqlDelete Source #

arrangeDeleteReturningSql :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> (columnsR -> Column SqlBool) -> (columnsR -> columnsReturned) -> String Source #

runDeleteReturning Source #

Arguments

:: Default FromFields columnsReturned haskells 
=> Connection 
-> Table a columnsR

Table to delete rows from

-> (columnsR -> Column SqlBool)

Predicate function f to choose which rows to delete. runDeleteReturning will delete rows for which f returns TRUE and leave unchanged rows for which f returns FALSE.

-> (columnsR -> columnsReturned) 
-> IO [haskells]

Returned rows which have been deleted

runDeleteReturningExplicit :: FromFields columnsReturned haskells -> Connection -> Table a columnsR -> (columnsR -> Column SqlBool) -> (columnsR -> columnsReturned) -> IO [haskells] Source #

arrangeDelete :: Table a columnsR -> (columnsR -> Column SqlBool) -> SqlDelete Source #

runInsert :: Connection -> Table fields fields' -> fields -> IO Int64 Source #

runInsertReturning :: Default FromFields fieldsReturned haskells => Connection -> Table fieldsW fieldsR -> fieldsW -> (fieldsR -> fieldsReturned) -> IO [haskells] Source #

runInsertReturningExplicit :: FromFields columnsReturned haskells -> Connection -> Table columnsW columnsR -> columnsW -> (columnsR -> columnsReturned) -> IO [haskells] Source #

runInsertManyReturningExplicitI :: FromFields columnsReturned haskells -> Connection -> Table columnsW columnsR -> [columnsW] -> (columnsR -> columnsReturned) -> IO [haskells] Source #

arrangeInsert :: Table columns a -> columns -> SqlInsert Source #

arrangeInsertSql :: Table columns a -> columns -> String Source #

arrangeInsertManyI :: Table columns a -> NonEmpty columns -> SqlInsert Source #

arrangeInsertManySqlI :: Table columns a -> NonEmpty columns -> String Source #

arrangeUpdate :: Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column SqlBool) -> SqlUpdate Source #

arrangeUpdateSql :: Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column SqlBool) -> String Source #

arrangeDeleteSql :: Table a columnsR -> (columnsR -> Column SqlBool) -> String Source #

arrangeInsertManyReturningI :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> NonEmpty columnsW -> (columnsR -> columnsReturned) -> Returning SqlInsert Source #

arrangeInsertManyReturningSqlI :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> NonEmpty columnsW -> (columnsR -> columnsReturned) -> String Source #

arrangeUpdateReturning :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column SqlBool) -> (columnsR -> columnsReturned) -> Returning SqlUpdate Source #

arrangeUpdateReturningSql :: Unpackspec columnsReturned ignored -> Table columnsW columnsR -> (columnsR -> columnsW) -> (columnsR -> Column SqlBool) -> (columnsR -> columnsReturned) -> String Source #