seancorfield / honeysql

Turn Clojure data structures into SQL
https://cljdoc.org/d/com.github.seancorfield/honeysql/CURRENT
1.76k stars 174 forks source link

Add NRQL dialect support #510

Closed seancorfield closed 1 year ago

seancorfield commented 1 year ago

https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/nrql-syntax-clauses-functions/

https://docs.newrelic.com/docs/query-your-data/nrql-new-relic-query-language/get-started/introduction-nrql-how-nrql-works/

seancorfield commented 1 year ago

Current status:

  (format {:select [:mulog/timestamp :mulog/event-name]
           :from   :Log
           :where  [:= :mulog/data.account "foo-account-id"]
           :since  [2 :days :ago]
           :limit 2000}
          {:dialect :nrql})
  ;; ["SELECT `mulog/timestamp`, `mulog/event-name` FROM Log
  ;;   WHERE `mulog/data.account` = 'foo-account-id' LIMIT 2000 SINCE 2 DAYS AGO"]

Needs FACET and WITH TIMEZONE added. Plus documentation.

seancorfield commented 1 year ago

:facet [:some.metric :another] or :facet [[:some.metric :alias] :another] -- no support yet for the more complex FACET CASES. Will wait for some demand for that 🙂