{"id":16445726,"url":"https://github.com/mnuessler/influxdb-clojure","last_synced_at":"2025-10-27T05:31:49.260Z","repository":{"id":62432972,"uuid":"58109394","full_name":"mnuessler/influxdb-clojure","owner":"mnuessler","description":"Clojure wrapper for the Java InfluxDB client","archived":false,"fork":false,"pushed_at":"2017-11-21T11:35:19.000Z","size":20,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T12:50:19.721Z","etag":null,"topics":["client","clojure","influxdb","time-series"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnuessler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-05T06:26:50.000Z","updated_at":"2019-06-14T01:31:09.000Z","dependencies_parsed_at":"2022-11-01T21:01:23.810Z","dependency_job_id":null,"html_url":"https://github.com/mnuessler/influxdb-clojure","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnuessler%2Finfluxdb-clojure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnuessler%2Finfluxdb-clojure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnuessler%2Finfluxdb-clojure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnuessler%2Finfluxdb-clojure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnuessler","download_url":"https://codeload.github.com/mnuessler/influxdb-clojure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238445856,"owners_count":19473823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","clojure","influxdb","time-series"],"created_at":"2024-10-11T09:45:12.220Z","updated_at":"2025-10-27T05:31:43.992Z","avatar_url":"https://github.com/mnuessler.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# InfluxDB Clojure\n\n[![Dependencies Status][depstatus-badge]][jarkeeper]\n[![Downloads][dl-badge]][jarkeeper]\n\nA simple [InfluxDB][influxdb] client for Clojure, implemented as a\nwrapper around the [Java InfluxDB client][influxdb-java]. Compatible\nwith InfluxDB \u003e= 0.9.\n\nIf you are lookig for officially supported InfluxDB clients please\nrefer to [this list][clients].\n\n## Artifacts\n\nArtifacts are [released to Clojars][clojars].\n\nIf you are using Maven, add the following repository definition to your `pom.xml`:\n\n```xml\n\u003crepository\u003e\n  \u003cid\u003eclojars.org\u003c/id\u003e\n  \u003curl\u003ehttp://clojars.org/repo\u003c/url\u003e\n\u003c/repository\u003e\n```\n\n### The Most Recent Release\n\nWith Leiningen:\n\n[![Clojars Project][clojars-latest-badge]][clojars]\n\nWith Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003einfluxdb\u003c/groupId\u003e\n  \u003cartifactId\u003einfluxdb-clojure\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nWith Gradle:\n\n```groovy\ncompile \"influxdb:influxdb-clojure:0.2.0\"\n```\n\n## Usage\n\nRequire the `influxdb-clojure` namespace:\n\n```clj\n(require '[influxdb-clojure.core :as influxdb])\n```\n\nOpen a connection:\n\n```clj\n(def conn (influxdb/connect \"http://localhost:8086\" \"root\", \"root\"))\n```\n\nCreate a database:\n\n```clj\n(influxdb/create-database conn \"mydb\")\n```\n\nShow existing databases:\n\n```clj\n(influxdb/databases conn)\n=\u003e (\"_internal\" \"mydb\")\n```\n\nDelete a database:\n\n```clj\n(influxdb/delete-database conn \"mydb\")\n(influxdb/databases conn)\n=\u003e (\"_internal\")\n```\n\n### Writing Data\n\nWrite a point to a database (retention policy \"default\"):\n\n```clj\n(def point {:measurement \"cpu_load_short\"\n            :fields {:value 0.64}\n            :time 1462428815668\n            :tags {:host \"server01\"\n                   :region \"us-west\"}})\n(influxdb/write-points conn \"mydb\" [point])\n```\n\n(The `time` is optional and will be set to the current system time if\nnot explicitly set.)\n\nOptionally, retention policy and consistency level may be specified:\n\n```clj\n(def opts {:retention-policy \"six_month_rollup\", :consistency-level :quorum})\n(influxdb/write-points conn \"mydb\" [point] opts)\n```\n\n### Querying Data\n\n```clj\n(influxdb/query conn \"SHOW DATABASES\")\n=\u003e\n{:results [{:series [{:name \"databases\",\n                      :colums [\"name\"],\n                      :values [[\"_internal\"] [\"mydb\"]]}]}]}\n```\n\n```clj\n(influxdb/query conn \"SELECT * FROM \\\"cpu_load_short\\\" WHERE host='server01'\" \"mydb\")\n=\u003e\n{:results [{:series [{:name \"cpu_load_short\",\n                      :colums [\"time\" \"host\" \"region\" \"value\"],\n                      :values [[\"2016-05-05T06:06:46.996Z\" \"server01\" \"us-west\" 0.64]]}]}]}\n```\n\n### HTTP Client Configuration\n\nIn some cases it may be useful to customize certain HTTP client\nparameters such as connect timeout. Timeout parameters can be passed\nas part of an option map when the connection is created (in ms):\n\n```clj\n(def opts {:connect-timeout 1000\n           :read-timeout    5000\n           :write-timeout   1000})\n(def conn (influxdb/connect \"http://localhost:8086\" \"root\", \"root\" opts))\n```\n\nIn case additional configuration for the HTTP client is required, a\nclient instance can be passed instead:\n\n```clj\n(import (retrofit.client OkClient)\n        (com.squareup.okhttp OkHttpClient)\n        (java.util.concurrent TimeUnit))\n(def http-client (OkHttpClient.))\n(.setConnectTimeout http-client 5000 (TimeUnit/MILLISECONDS))\n(.setReadTimeout http-client 5000 (TimeUnit/MILLISECONDS))\n(def client (OkClient. http-client))\n(def conn (influxdb/connect \"http://localhost:8086\" \"root\", \"root\" {:client client}))\n```\n\n## License\n\nCopyright © 2016 Matthias Nüßler\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n\n[clients]: https://docs.influxdata.com/influxdb/v0.12/clients/api/\n[clojars]: https://clojars.org/influxdb/influxdb-clojure\n[influxdb]: https://influxdata.com/time-series-platform/influxdb/\n[influxdb-java]: https://github.com/influxdata/influxdb-java\n[jarkeeper]: https://jarkeeper.com/mnuessler/influxdb-clojure\n\n[depstatus-badge]: https://jarkeeper.com/mnuessler/influxdb-clojure/status.svg\n[dl-badge]: https://jarkeeper.com/mnuessler/influxdb-clojure/downloads.svg\n[clojars-latest-badge]: http://clojars.org/influxdb/influxdb-clojure/latest-version.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnuessler%2Finfluxdb-clojure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnuessler%2Finfluxdb-clojure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnuessler%2Finfluxdb-clojure/lists"}