Skip to content

sirherrbatka/vellum-postmodern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vellum-postmodern

This system adds a basic support for constructing vellum tables from the queries to the postgres database. S-SQL syntax is supported.

Example

(vellum:copy-from :postmodern
`(:select 'primary_dgns_cd 'anchip_icd10d_codes
          'pac1 'readm_90_days 'death_in_postdisch
          'history_d_10
      :from 'lds2019
      :inner-join 'first_pacs
      :on (:= (:type 'lds2019.episode_id varchar)
               'first_pacs.episode_id)
      :where (:and (:= 'mdc ,mdc)
                   (:not 'death_in_anchor)))
 :columns '(primary-dgns-cd anchip-icd10d-codes pac1 readm-90-days death-in-postdisch history-d-10))

Prepare statements are also supported.

(postmodern:with-connection *connection-parameters*
  (cl-postgres:prepare-query postmodern:*database* "test" "select * from test;")
  (vellum:copy-from :postmodern "test" :columns '(id name) :prepared t))

You can also pass arguments to the prepared statement with :parameters option.