{"id":16488721,"url":"https://github.com/bts/jdbca","last_synced_at":"2025-06-25T09:37:56.042Z","repository":{"id":28344753,"uuid":"31858275","full_name":"bts/jdbca","owner":"bts","description":"An asynchronous Clojure interface to JDBC","archived":false,"fork":false,"pushed_at":"2015-03-14T15:50:27.000Z","size":342,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T17:48:16.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-08T17:21:37.000Z","updated_at":"2019-11-21T23:53:29.000Z","dependencies_parsed_at":"2022-08-25T10:01:12.750Z","dependency_job_id":null,"html_url":"https://github.com/bts/jdbca","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fjdbca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fjdbca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fjdbca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bts%2Fjdbca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bts","download_url":"https://codeload.github.com/bts/jdbca/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241306553,"owners_count":19941322,"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":[],"created_at":"2024-10-11T13:39:45.414Z","updated_at":"2025-03-01T02:24:07.983Z","avatar_url":"https://github.com/bts.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdbca\n\nAn **in-progress** asynchronous [manifold](https://github.com/ztellman/manifold) interface to the synchronous [java.jdbc](https://github.com/clojure/java.jdbc) using a [dirigiste](https://github.com/ztellman/dirigiste) [thread pool](http://ideolalia.com/dirigiste/io/aleph/dirigiste/Executor.html). This library is [not yet ready](#caveats) for serious use.\n\n```clojure\n[jdbca \"0.1.0-SNAPSHOT\"]\n```\n\n## Usage\n\n```clojure\n(require '[jdbca :as j])\n(require '[manifold.stream :as s])\n\n;; db would be a connection pool in production code\n(def db {:subprotocol \"postgresql\"\n         :subname \"//localhost:5432/bts\"\n         :user \"bts\"\n         :password \"\"})\n\n(-\u003e (j/query db [\"select *, pg_sleep(1) from dogs where name = ?\" \"abe\"])\n  (d/chain\n    (partial s/map :name)\n    s/take!)\n  (d/catch\n    (fn [e] \"caught: \" e)))\n;=\u003e \u003c\u003c … \u003e\u003e\n*1\n;=\u003e \u003c\u003c \"abe\" \u003e\u003e\n```\n\n## Caveats\n\nThis project currently only contains the JDBC functionality I need in another project. Contributions are welcome.\n\nNext on the list is transaction support. I'm currently considering a faux-monadic interface that's a blend of  [`let-flow`](https://github.com/ztellman/manifold/blob/master/docs/deferred.md#let-flow) and postgres.async's [`dosql`](https://github.com/alaisi/postgres.async#composition), where each of the bindings will be made sequentially, and any failure will result in the entire form realizing an error-deferred:\n\n```clojure\n(j/do [tx (j/begin {:isolation :serializable})\n       rs1 (j/execute! tx [\"insert into dogs (name) values (?)\" \"new dog\"])\n       rs2 (j/execute! tx [\"insert into cats (name) values (?)\" \"new cat\"])\n       _ (j/commit!)]\n  (concat rs1 rs1))\n```\n\nTo simplify transaction semantics, I think the current `j/query` function should probably be changed to just return a deferred yielding a clojure sequence instead of a manifold stream.\n\n## License\n\nCopyright © 2015 Brian Schroeder\n\nDistributed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbts%2Fjdbca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbts%2Fjdbca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbts%2Fjdbca/lists"}