Comments (1)
Hi, I am the lead developer of HikariCP and I have a question about the documentation. The ?documentation section for HikariCP starts with:
This adapter does not respects the standard dbspec format, it has its own format and depends
completely of used adapter. This is happens because HikariCP works as some kind of wrapper and it
forward almost all parameters to the wrapped datasource.I am not sure what this means? All connection pools, including C3P0 and DBCP, "wrap" datasources. HikariCP wraps datasources in exactly the same way as other pools and should be just as transparent (indistinguishable from them).
Ok, it maybe I'm wrong about the wrapper concept, but hikaricp is the first one that makes me awareness about it. Having to specify the datasource class. Other connection pool libraries requires only a jdbc url and optionally username and password.
About dbspec
, why is not compliant? (obvliously I'm talking about dbspec format used in clojure community)
Because, with difference to other connection pool libraries, hikaricp does not recommend use jdbc url and relies a lot of forwarding options to "inner" datasource, making the connection parameters very heterogeneous.
With any jdbc library:
jdbc:postgresql://hostname/dbname
jdbc:h2:mem: or jdbc:h2:/tmp/file.db
But with hikaricp, the recommended way is not setting this url, instead of it I should pass specific parameters of each datasource (and they slightly heterogeneous).
Example for postgresql
HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(100);
config.setDataSourceClassName("org.postgresql.ds.PGSimpleDataSource");
config.addDataSourceProperty("serverName", "localhost");
config.addDataSourceProperty("port", "3306");
config.addDataSourceProperty("databaseName", "test");
Example for h2
HikariConfig config = new HikariConfig();
config.setMaximumPoolSize(100);
config.setDataSourceClassName("org.h2.jdbcx.JdbcDataSource");
config.addDataSourceProperty("url", "mem:")
Having this, the dbspec (clojure map with :subprotocol and :subname) it can not be translated directly and uniformly to specific parameters for each datasource class that are available (because each database datasource implementation has it own parameters, that makes it difficult make them in one uniform format) to specific format of each datasource.
Almost all connection libraries that I know, they abstract me from inner datasource class. They are only make me specify a jdbcUrl and optionally password and username. With hikaricp, I should pass a specific options of used datasource class, making connecting to different databases have to specify different kind of parameters. It is not bad, it simply different.
I'm really happy with hikaricp but, I cannot make my clojure adapter compatible with the same dbspec format like others, because of reasons exposed previously.
Also, HikariCP adapter targets to only JDK8 version.
HikariCP has both Java 6/7 support and Java 8 support via different JAR artifacts.
I know it, but I'm not using directly hikari (I'm really considering it), instead of it, I'm currently using https://github.com/tomekw/hikari-cp this one that I found on your hikaricp readme.
As I said previously, I'm still reconsidering using that library and make my own adaptation, making it available without any problems with support for java 6 7 and 8. Also, I'm not very happy with the license of tomekw/hikari-cp :D
Thanks to you for your fantastic work on hikaricp :D
from clojure.jdbc.
Related Issues (20)
- Helpers functions to retrieve database metadata HOT 2
- How to execute! multiple SQL commands over a connection? HOT 2
- jdbc driver :classname in db spec HOT 1
- Which version of hikari-cp should be used with clojure.jdbc? HOT 2
- Remove potemkin dependency HOT 2
- .getGeneratedKeys support HOT 9
- How are Postgres `time` columns being cast to Date type on SELECT? HOT 2
- Various Derby URLs fail in core.jdbc/connection HOT 1
- Why fetch result column-name are lowercased ? HOT 3
- reflection warnings HOT 1
- org.h2.jdbc.JdbcBatchUpdateException HOT 1
- Wrong isolation level constants in documentation HOT 1
- Close connections when using a datasource directly, or don't let it be used directly.
- Docs: consider mentioning :identifiers and :as-rows? options
- Reflection warnings (types.clj, impl.clj)
- Docs: clarify cursor behavior HOT 4
- java.time interop
- Java 7 Requirement? HOT 2
- Lower Case Identifiers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clojure.jdbc.