Skip to content

Instantly share code, notes, and snippets.

@usametov
Forked from apeckham/simba.clj
Created May 25, 2024 18:36
Show Gist options
  • Save usametov/58f5e1600f1784f13fecd1b1745e3207 to your computer and use it in GitHub Desktop.
Save usametov/58f5e1600f1784f13fecd1b1745e3207 to your computer and use it in GitHub Desktop.
connect to bigquery with clojure.java.jdbc
(ns simba
(:require [clojure.java.jdbc :as j])
(:import (com.simba.googlebigquery.jdbc42 Driver)))
(def conn {:classname "com.simba.googlebigquery.jdbc42.Driver"
:subprotocol "bigquery"
:subname "//https://www.googleapis.com/bigquery/v2:443;ProjectId=MY-PROJECT-ID;[email protected];OAuthPvtKeyPath=PATH-TO-P12-FILE"})
(defn run-query [query] (j/query conn [query]))
(prn (run-query "select 1"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment