seancorfield / next-jdbc

A modern low-level Clojure wrapper for JDBC-based access to databases.
https://cljdoc.org/d/com.github.seancorfield/next.jdbc/
Eclipse Public License 1.0
768 stars 90 forks source link

Add default data-source settings for MariaDB. #100

Closed green-coder closed 4 years ago

green-coder commented 4 years ago

I did not add tests, as I am not sure how you would want them to be, as mariadb is pretty close to mysql.

seancorfield commented 4 years ago

The two lists of things you've updated are in alphabetical order -- except for what you've inserted. I can either just insert them myself in alpha order or you can update the PR to put them in order.

Testing is somewhat tricky because if the MariaDB driver is on the classpath, it will also intercept jdbc:mysql URLs unless disableMariaDbDriver is added to the MySQL URL. I'll have to give that some thought. Either way, all of the test logic that does something different for mysql? would also need to consider maria? (I'll need to add that).

seancorfield commented 4 years ago

Note for myself, the Maven coord for MariaDB is org.mariadb.jdbc/mariadb-java-client {:mvn/version "2.5.4"}

green-coder commented 4 years ago

The two lists of things you've updated are in alphabetical order -- except for what you've inserted. I can either just insert them myself in alpha order or you can update the PR to put them in order.

Please insert them yourself, no need to wait for me.

seancorfield commented 4 years ago

OK. Thanks for the info on MariaDB -- I've learned stuff from that!

seancorfield commented 4 years ago

The MariaDB lines in next.jdbc.connection/dbtypes still weren't in alpha order but I've merged it anyway and will work on the tests/documentation/etc later today.

seancorfield commented 4 years ago

@green-coder In case you're interested, see the commit where I fleshed out the rest of the MariaDB stuff. I wasn't able to have it automatically intercept the "mysql" JDBC URL but I think that's more because the code is explicit about selecting the driver class, based on :dbtype. I could, in theory, just fall back to the MariaDB driver for "mysql" but I think I will leave it this way for now -- I don't know how many people use MariaDB and I don't know what subset of those would still want the MariaDB driver to be used for JDBC URLs that don't have "mariadb" in them!