Liking cljdoc? Tell your friends :D

Debugging & Troubleshooting

Viewing entities & attributes of a DB schema

The db-adapter returned from honeyeql.db/initialize is a Record that has a key :heql-meta-data with the value contains all the metadata queried and computed by HoneyEQL.

This map has two keys :attributes and :entities pointing to their respective metadata.

You can make use of Portal or Reveal to visualize this map.

Here is a sample Code Snippet for how to do it

(comment
  (def pg-adapter (heql-db/initialize {:dbtype   "postgres"
                                       :dbname   "graphqlize"
                                       :user     "postgres"
                                       :password "postgres"}))

  ; portal
  (require '[portal.api :as p])
  (p/open)
  (add-tap #'p/submit)
  (tap> pg-adapter)
  (p/close)

  ; reveal

Viewing Query Execution Steps

HoneyEQL makes extensive use of tap> function to log all the intermediate steps of query executions.

When we execute an HoneyEQL query like this,

(heql/query-single pg-adapter {[:actor/actor-id 148]
                                [:actor/first-name
                                {:actor/films [[:count :film/film-id]]}]})

the following values are getting "tapped"

; :sql - Generated SQL 
; :hsql - Generated Honey SQL 
; :eql-ast - AST of EQL 

You can make use of Portal or Reveal as mentioned earlier to view this taps

Can you improve this documentation?Edit on GitHub

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

× close