Clojure Library to query AWS Athena
The library provides just one function `query` that takes
- A query Map defined using https://github.com/omnyway-labs/sqly EDN form
- A Values map that overlays the Template variables
Add below git coordinates in deps.edn
omnyway-labs/loki
{:git/url "https://github.com/omnyway-labs/loki.git",
:sha "2806b3686855ff762dfc21feece39054a952d074"}
(init! "s3://my-results-bucket"
{:auth-type :profile
:profile (System/getenv "AWS_PROFILE")
:region "us-east-1"})
(require '[loki.core :as loki])
(loki/query sqly-query-map values overrides)
;; example
(loki/query database-name
{:select {:timestamp :datetime :id :session-id},
:from :orders
:order-by [[:timestamp :desc]]
:where {:id "{{order-id}}"}}
{:order-id "xyz123"}
{:limit 3})
Copyright 2019 Omnyway Inc.
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Samrat - https://github.com/samrat for initial work and render fn