{"id":18646758,"url":"https://github.com/metabase/connection-pool","last_synced_at":"2025-07-11T03:07:24.780Z","repository":{"id":45986475,"uuid":"192020718","full_name":"metabase/connection-pool","owner":"metabase","description":"Connection pools for JDBC databases. Simple wrapper around C3P0.","archived":false,"fork":false,"pushed_at":"2024-12-11T21:53:49.000Z","size":36,"stargazers_count":14,"open_issues_count":0,"forks_count":9,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-06-25T09:58:20.067Z","etag":null,"topics":["c3p0","clojure","clojure-jdbc","connection-pool","connection-pooler","connection-pooling","database","jdbc","metabase"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metabase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-15T00:46:34.000Z","updated_at":"2024-12-11T21:53:31.000Z","dependencies_parsed_at":"2025-04-11T18:12:00.791Z","dependency_job_id":"bc879d06-2131-4d1d-9518-abc5092c577f","html_url":"https://github.com/metabase/connection-pool","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/metabase/connection-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fconnection-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fconnection-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fconnection-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fconnection-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metabase","download_url":"https://codeload.github.com/metabase/connection-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metabase%2Fconnection-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264719240,"owners_count":23653542,"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":["c3p0","clojure","clojure-jdbc","connection-pool","connection-pooler","connection-pooling","database","jdbc","metabase"],"created_at":"2024-11-07T06:22:28.823Z","updated_at":"2025-07-11T03:07:24.754Z","avatar_url":"https://github.com/metabase.png","language":"Clojure","readme":"[![Downloads](https://versions.deps.co/metabase/connection-pool/downloads.svg)](https://versions.deps.co/metabase/connection-pool)\n[![Dependencies Status](https://versions.deps.co/metabase/connection-pool/status.svg)](https://versions.deps.co/metabase/connection-pool)\n[![Circle CI](https://circleci.com/gh/metabase/connection-pool.svg?style=svg)](https://circleci.com/gh/metabase/connection-pool)\n[![License](https://img.shields.io/badge/license-Eclipse%20Public%20License-blue.svg)](https://raw.githubusercontent.com/metabase/connection-pool/master/LICENSE)\n[![cljdoc badge](https://cljdoc.org/badge/metabase/connection-pool)](https://cljdoc.org/d/metabase/connection-pool/CURRENT)\n\n[![Clojars Project](https://clojars.org/metabase/connection-pool/latest-version.svg)](http://clojars.org/metabase/connection-pool)\n\n### Creating a Connection Pool\n\n#### From a `clojure.java.jdbc` spec\n\nYou can create a C3P0 connection pool with any `clojure.java.jdbc` connection spec map with `:subname` and\n`:subprotocol` keys. `connection-pool-spec` will return a `clojure.java.jdbc` connection spec you can use directly:\n\n```clj\n(require '[clojure.java.jdbc :as jdbc]\n         '[metabase.connection-pool :as connection-pool])\n\n;;; Create a C3P0 connection pool\n\n(let [pool-spec (connection-pool/connection-pool-spec my-jdbc-spec)]\n  (jdbc/query pool-spec [\"SELECT *\"]))\n  ```\n\n(You will almost certainly want to store your pool somewhere, such as in an atom).\n\n#### From a JDBC URL String:\n\nYou can create a pooled `DataSource` (e.g., for use with [`next-jdbc`](https://github.com/seancorfield/next-jdbc)) by calling `pooled-data-source-from-url`:\n\n```clj\n(require '[next.jdbc :as jdbc]\n         '[metabase.connection-pool :as connection-pool])\n\n(with-open [connection (jdbc/get-connection (connection-pool/pooled-data-source-from-url \"jdbc:postgresql:localhost:3000/my_db\"))]\n  (reduce my-fn init-value (jdbc/plan connection [\"SELECT *\"])))\n```\n\n### Configuring the connection pool\n\nYou can set connection pool options such as size in a `c3p0.properties` file, or by passing them as a map to `connection-pool-spec`:\n\n```clj\n(def ^:private connection-pool-properties\n  {\"maxIdleTime\"     (* 3 60 60)\n   \"minPoolSize\"     1\n   \"initialPoolSize\" 1\n   \"maxPoolSize\"     15})\n\n(def my-pool-spec\n  (connection-pool/connection-pool-spec my-jdbc-spec connection-pool-properties))\n```\n\nSee [https://www.mchange.com/projects/c3p0/#configuration_properties](https://www.mchange.com/projects/c3p0/#configuration_properties) for a list of all options.\n\n### Destroying connection pools\n\n`destroy-connection-pool!` will destroy the connection pool you created:\n\n```clj\n(connection-pool/destroy-connection-pool! pool-spec)\n```\n\n### Legal Stuff\n\nCopyright © 2019 [Metabase, Inc](https://metabase.com/). This project is licensed under the Eclipse Public License, same as Clojure.\n","funding_links":[],"categories":["Connection pools"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabase%2Fconnection-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetabase%2Fconnection-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetabase%2Fconnection-pool/lists"}