Clean up and small doc improvements

This commit is contained in:
Sean Corfield 2019-05-10 14:17:49 -07:00
parent ca677b2937
commit 45f25d1912
5 changed files with 20 additions and 25 deletions

View file

@ -1,23 +1,19 @@
version: 2 # use CircleCI 2.0 version: 2
jobs: # basic units of work in a run jobs:
build: # runs not using Workflows must have a `build` job as entry point build:
working_directory: ~/next-jdbc working_directory: ~/next-jdbc
docker: # run the steps with Docker docker:
- image: circleci/clojure:openjdk-11-tools-deps-1.10.0.442 - image: circleci/clojure:openjdk-11-tools-deps-1.10.0.442
# environment: # environment variables for primary container # environment:
# JVM_OPTS: -Xmx3200m # limit the maximum heap size to prevent out of memory errors # JVM_OPTS: -Xmx3200m
steps: # commands that comprise the `build` job steps:
- checkout # check out source code to working directory - checkout
- restore_cache: # restores saved cache if checksum hasn't changed since the last run - restore_cache:
key: next-jdbc-{{ checksum "deps.edn" }} key: next-jdbc-{{ checksum "deps.edn" }}
- run: clojure -A:test:runner-ci -Spath - run: clojure -A:test:runner-ci -Spath
- save_cache: # generate and store cache in the .m2 directory using a key template - save_cache:
paths: paths:
- ~/.m2 - ~/.m2
- ~/.gitlibs - ~/.gitlibs
key: next-jdbc-{{ checksum "deps.edn" }} key: next-jdbc-{{ checksum "deps.edn" }}
- run: clojure -A:test:runner - run: clojure -A:test:runner
# - store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/
# path: target/uberjar/cci-demo-clojure.jar
# destination: uberjar
# See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples

View file

@ -8,6 +8,7 @@
## Unreleased Changes ## Unreleased Changes
The following changes have been committed to the **master** branch and will be in the next release: The following changes have been committed to the **master** branch and will be in the next release (Beta 1):
* Set up CircleCI testing (just local DBs for now).
* Fix #19 by caching loaded database driver classes. * Fix #19 by caching loaded database driver classes.

View file

@ -7,12 +7,10 @@
org.hsqldb/hsqldb {:mvn/version "2.4.1"} org.hsqldb/hsqldb {:mvn/version "2.4.1"}
com.h2database/h2 {:mvn/version "1.4.197"} com.h2database/h2 {:mvn/version "1.4.197"}
net.sourceforge.jtds/jtds {:mvn/version "1.3.1"} net.sourceforge.jtds/jtds {:mvn/version "1.3.1"}
;; Note: Tests fail with 6.0.2+ driver
mysql/mysql-connector-java {:mvn/version "5.1.41"} mysql/mysql-connector-java {:mvn/version "5.1.41"}
org.postgresql/postgresql {:mvn/version "42.2.2.jre7"} org.postgresql/postgresql {:mvn/version "42.2.2.jre7"}
com.impossibl.pgjdbc-ng/pgjdbc-ng {:mvn/version "0.7.1"} com.impossibl.pgjdbc-ng/pgjdbc-ng {:mvn/version "0.7.1"}
org.xerial/sqlite-jdbc {:mvn/version "3.23.1"} org.xerial/sqlite-jdbc {:mvn/version "3.23.1"}
;; Note: Assumes Java 8; there's a .jre7 version as well
com.microsoft.sqlserver/mssql-jdbc {:mvn/version "6.2.2.jre8"}}} com.microsoft.sqlserver/mssql-jdbc {:mvn/version "6.2.2.jre8"}}}
:runner-ci ; to get deps cached on CircleCI :runner-ci ; to get deps cached on CircleCI
{:extra-deps {com.cognitect/test-runner {:extra-deps {com.cognitect/test-runner

View file

@ -8,13 +8,13 @@ The most general options are described first, followed by more specific options
Although `get-datasource` does not accept options, the "db spec" hash map passed in may contain the following options: Although `get-datasource` does not accept options, the "db spec" hash map passed in may contain the following options:
* `dbtype` -- a string that identifies the type of JDBC database being used, * `:dbtype` -- a string that identifies the type of JDBC database being used,
* `dbname` -- a string that identifies the name of the actual database being used, * `:dbname` -- a string that identifies the name of the actual database being used,
* `host` -- an optional string that identifies the IP address or hostname of the server on which the database is running; the default is `"127.0.0.1"`, * `:host` -- an optional string that identifies the IP address or hostname of the server on which the database is running; the default is `"127.0.0.1"`,
* `port` -- an optional integer that identifies the port on which the database is running; for common database types, `next.jdbc` knows the default so this should only be needed for non-standard setups or "exotic" database types, * `:port` -- an optional integer that identifies the port on which the database is running; for common database types, `next.jdbc` knows the default so this should only be needed for non-standard setups or "exotic" database types,
* `classname` -- an optional string that identifies the name of the JDBC driver class to be used for the connection; for common database types, `next.jdbc` knows the default so this should only be needed for "exotic" database types, * `:classname` -- an optional string that identifies the name of the JDBC driver class to be used for the connection; for common database types, `next.jdbc` knows the default so this should only be needed for "exotic" database types,
* `user` -- an optional string that identifies the database username to be used when authenticating, * `:user` -- an optional string that identifies the database username to be used when authenticating,
* `password` -- an optional string that identifies the database password to be used when authenticating. * `:password` -- an optional string that identifies the database password to be used when authenticating.
Any additional keys provided in the "db spec" will be passed to the JDBC driver as `Properties` when each connection is made. Any additional keys provided in the "db spec" will be passed to the JDBC driver as `Properties` when each connection is made.

View file

@ -51,7 +51,7 @@ If you are using `:result-set-fn` and/or `:row-fn`, you will need to change to e
These are mostly drawn from [Issue #5](https://github.com/seancorfield/next-jdbc/issues/5) although most of the bullets in that issue are described in more detail above. These are mostly drawn from [Issue #5](https://github.com/seancorfield/next-jdbc/issues/5) although most of the bullets in that issue are described in more detail above.
* Keyword options no longer end in `?` -- to reflect the latest best practice on predicates vs. attributes, * Keyword options no longer end in `?` -- for consistency (in `clojure.java.jdbc`, some flag options ended in `?` and some did not; also some options that ended in `?` accepted non-`Boolean` values, e.g., `:as-arrays?` and `:explain?`),
* `with-db-connection` has been replaced by just `with-open` containing a call to `get-connection`, * `with-db-connection` has been replaced by just `with-open` containing a call to `get-connection`,
* `with-transaction` can take a `:rollback-only` option, but there is no way to change a transaction to rollback _dynamically_; throw an exception instead (all transactions roll back on an exception) * `with-transaction` can take a `:rollback-only` option, but there is no way to change a transaction to rollback _dynamically_; throw an exception instead (all transactions roll back on an exception)
* The extension points for setting parameters and reading columns are now `SettableParameter` and `ReadableColumn` protocols. * The extension points for setting parameters and reading columns are now `SettableParameter` and `ReadableColumn` protocols.