Git Product home page Git Product logo

Comments (11)

rvangsgaard avatar rvangsgaard commented on August 30, 2024

Hmmm, it may the documentation that should be more accurate. I eventually found the required settings in HikariCPConfig

I cannot switch to Hikari proeprty file as, as I am using some features of TypesafeConfig in my db url.

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

Yes, the docs are wrong. I will probably close this issue after #4, since I will need to remap BoneCP properties to HikariCP avoiding deprecated properties.

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

By the way, about this:

I cannot switch to Hikari proeprty file as, as I am using some features of TypesafeConfig in my db url.

Could you please elaborate about which features are you using that prevents you to use a properties file? Is this change enough to enables you to migrate to a properties file?

from play-hikaricp.edulify.com.

rvangsgaard avatar rvangsgaard commented on August 30, 2024

I do something like this, the mysql.url-params are the culprit here:

mysql.url-params="cachePrepStmts=true&prepStmtCacheSize=250&prepStmtCacheSqlLimit=2048"
db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://"${DATABASE_HOST}/${DATABASE_SCHEMA}?${mysql.url-params}

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

Hum, that is already supported in the current release (1.2.0), you can both reference another property (using ${some.property.name}) and environment variables (using ${env:SOME_ENV_VAR}).

Here is what is supported by commons configuration, which is used to read the hikaricp.properties file:

http://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeatures.html#Variable_Interpolation

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

Anyway, I will leave this issue open because we need to correct the docs.

from play-hikaricp.edulify.com.

rvangsgaard avatar rvangsgaard commented on August 30, 2024

Ah yes, my example was not precise enough. I have mysql.url-params defined in application.conf (Typesafe Config), and are referencing it in all the other config files - but commons configuration will not read references from the "parent" configuration.

I am trying to achieve that I only have to specify these parameters once, at reference it from all other mysql configurations.

from play-hikaricp.edulify.com.

rvangsgaard avatar rvangsgaard commented on August 30, 2024

Support for embedded Typesafe Config would be great. Then something like this:

val subConfig = getConfig("db.default")
val Seq[(String, String)] = subConfig.map(_.keys.map{key => (key, subConfig.getString(key))}
// convert to java.util.Properties - send it to HikariCPConfig

What do you think?

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

Sounds good. Maybe we could ditch the translation of bonecp->hikaricp in favor of this option. Also, since Typesafe Config supports environment variables, we could use it instead of commons configuration.

from play-hikaricp.edulify.com.

dkharrat avatar dkharrat commented on August 30, 2024

+1

@megazord direct typesafe config (HOCON) support sounds like exactly what I'm suggesting in issue #36

from play-hikaricp.edulify.com.

megazord avatar megazord commented on August 30, 2024

Master branch already has dropped the translation from bonecp to hikaricp.

from play-hikaricp.edulify.com.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.