Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom 'options' connection property #1356

Merged
merged 4 commits into from Dec 6, 2018

Conversation

Projects
None yet
4 participants
@leskin-in
Copy link
Contributor

commented Nov 27, 2018

Add support for custom options connection property. The property is described in PostgreSQL documentation; the motivation for its introduction was discussed in #222 (which is closed by this PR).

Implementation is straightforward: a new PGProperty is introduced to store options parameter value. It works the same way as any other PGProperty, thus it can be passed either in URL or in Properties object.

The documentation is updated to mention new connection property. Also, a note is added that when some property is present both in URL and in Properties object, the first one is prioritized.

TestUtil is updated so that it reads options property provided by testing environment.

A new OptionsPropertyTest is added.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Does mvn checkstyle:check pass?

Changes to Existing Features:

  • Does this preserve the existing behaviour? If not, please explain.
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?
Show resolved Hide resolved README.md Outdated
Show resolved Hide resolved pgjdbc/src/main/java/org/postgresql/core/v3/ConnectionFactoryImpl.java

leskin-in added some commits Nov 14, 2018

feat: support custom 'options' connection property
* add support for custom 'options' connection property
* add parsing of 'options' to TestUtil

this closes #222
doc: update documentation to mention custom 'options' connection prop…
…erty support

* update README.md and docs/documentation/head/connect.md so that they mention 'options' connection
parameter

@leskin-in leskin-in force-pushed the arenadata:custom_pgoptions_support branch from 9e69f70 to 67acab8 Nov 27, 2018

@codecov-io

This comment has been minimized.

Copy link

commented Nov 27, 2018

Codecov Report

Merging #1356 into master will increase coverage by 0.01%.
The diff coverage is 71.42%.

@@             Coverage Diff              @@
##             master    #1356      +/-   ##
============================================
+ Coverage     68.65%   68.67%   +0.01%     
- Complexity     3889     3892       +3     
============================================
  Files           179      179              
  Lines         16391    16398       +7     
  Branches       2669     2670       +1     
============================================
+ Hits          11253    11261       +8     
  Misses         3888     3888              
+ Partials       1250     1249       -1

leskin-in added some commits Nov 27, 2018

docs: change 'options' property description
* change 'options' property descriptions to make it more specific

proposed by @vlsi
test: add unit test for 'options' connection initialization parameter
* add a unit test to check 'options' connection initialization parameter is passed to the database
To do that, a schema is created. search_path is then set by 'options' to its name, and is checked
after establishing a connection

@leskin-in leskin-in force-pushed the arenadata:custom_pgoptions_support branch from 38883ef to cf10178 Nov 28, 2018

@davecramer

This comment has been minimized.

Copy link
Member

commented Dec 6, 2018

@leskin-in I'd like to push this but I'm waiting for you to respond to the review

@davecramer davecramer merged commit 7be21fc into pgjdbc:master Dec 6, 2018

2 checks passed

codecov/project 68.66% (+0.01%) compared to 381cf45
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@leskin-in

This comment has been minimized.

Copy link
Contributor Author

commented Dec 6, 2018

@davecramer , thank you for clarification. I have added commits 67acab8 and cf10178 which address issues described in the review, and have been waiting for confirmation from @vlsi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.