squeal-postgresql-0.9.0.0: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Manipulation.Call

Contents

Description

call statements

Synopsis

Call

call Source #

Arguments

:: (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))

unsafeCall Source #

Arguments

:: ByteString

procedure to call

-> Expression 'Ungrouped '[] with db params '[] x

arguments

-> Manipulation with db params '[] 
>>> printSQL $ unsafeCall "p" true
CALL p(TRUE)

callN Source #

Arguments

:: (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))

unsafeCallN Source #

Arguments

:: 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)