Liking cljdoc? Tell your friends :D

Functions

Function calls (and expressions with operators) can be specified as vectors where the first element is the keyword representing the function name.

; :eql.mode/lenient syntax
(heql/query-single pg-adapter [{[:employee/id 1]
                                  [[[:upper :employee/first-name] :as :employee/first-name]]}])
; :eql.mode/strict syntax
(heql/query-single pg-adapter `[{([:employee/id 1])
                                   [[[:upper :employee/first-name] :as :employee/first-name]]}])

It returns

#:employee{:first-name "ANDREW"}

Multi Arity Function

NOTE: Supported only for Postgres

; :eql.mode/lenient syntax
(heql/query-single pg-adapter
                     {[:employee/id 1]
                      [[[:concat :employee/first-name " " :employee/last-name] :as :employee/full-name]]})
; :eql.mode/strict syntax
(heql/query-single pg-adapter
                     `[{([:employee/id 1])
                        [[[:concat :employee/first-name " " :employee/last-name] :as :employee/full-name]]}])

It returns

#:employee{:full-name "Andrew Adams"}
; :eql.mode/lenient syntax
(heql/query-single pg-adapter
                    {[:employee/id 7]
                    [[[:pgp_sym_decrypt [:cast :employee/ssn :bytea] "encryption-key"] :as :employee/ssn]]})

; :eql.mode/strict syntax
(heql/query-single pg-adapter
                    `[{([:employee/id 7])
                      [[[:pgp_sym_decrypt [:cast :employee/ssn :bytea] "encryption-key"] :as :employee/ssn]]}])

It returns

#:employee{:ssn "xxxxxxxxxxxxx"}

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close