Copyright | (c) Eitan Chatav 2019 |
---|---|
Maintainer | eitan@morphism.tech |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
call statements
Synopsis
- call :: (Has sch db schema, Has pro schema ('Procedure '[x])) => QualifiedAlias sch pro -> Expression 'Ungrouped '[] with db params '[] x -> Manipulation with db params '[]
- unsafeCall :: ByteString -> Expression 'Ungrouped '[] with db params '[] x -> Manipulation with db params '[]
- callN :: (Has sch db schema, Has pro schema ('Procedure xs), SListI xs) => QualifiedAlias sch pro -> NP (Expression 'Ungrouped '[] with db params '[]) xs -> Manipulation with db params '[]
- unsafeCallN :: SListI xs => ByteString -> NP (Expression 'Ungrouped '[] with db params '[]) xs -> Manipulation with db params '[]
Call
:: (Has sch db schema, Has pro schema ('Procedure '[x])) | |
=> QualifiedAlias sch pro | procedure to call |
-> Expression 'Ungrouped '[] with db params '[] x | arguments |
-> Manipulation with db params '[] |
Call a user defined procedure of one variable.
>>>
type Schema = '[ "p" ::: 'Procedure '[ 'NotNull 'PGint4 ] ]
>>>
:{
let p :: Manipulation '[] (Public Schema) '[] '[] p = call #p 1 in printSQL p :} CALL "p"((1 :: int4))
:: ByteString | procedure to call |
-> Expression 'Ungrouped '[] with db params '[] x | arguments |
-> Manipulation with db params '[] |
>>>
printSQL $ unsafeCall "p" true
CALL p(TRUE)
:: (Has sch db schema, Has pro schema ('Procedure xs), SListI xs) | |
=> QualifiedAlias sch pro | procedure to call |
-> NP (Expression 'Ungrouped '[] with db params '[]) xs | arguments |
-> Manipulation with db params '[] |
Call a user defined procedure.
>>>
type Schema = '[ "p" ::: 'Procedure '[ 'NotNull 'PGint4, 'NotNull 'PGtext ] ]
>>>
:{
let p :: Manipulation '[] (Public Schema) '[] '[] p = callN #p (1 *: "hi") in printSQL p :} CALL "p"((1 :: int4), (E'hi' :: text))
:: SListI xs | |
=> ByteString | procedure to call |
-> NP (Expression 'Ungrouped '[] with db params '[]) xs | arguments |
-> Manipulation with db params '[] |
>>>
printSQL $ unsafeCallN "p" (true *: false)
CALL p(TRUE, FALSE)