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

Cleanup PGProperty, sort values, and add some missing to docs #1686

Merged
merged 9 commits into from Jan 30, 2020

Conversation

sehrope
Copy link
Member

@sehrope sehrope commented Jan 30, 2020

Alternative to #1504 (I'll close that one out in a min in favor of this). This PR is rebased atop the latest additions for new properties and docs. It passes checkstyle and tests. Should not have any end user change as the only thing modified is the declaration order of the PGProperty enums and I can't imagine the previous sort order being used for anything (it was effectively random anyway).

Summary of PGProperty changes:

  • misc: Remove variadic constructor for PGProperty values and split across multiple lines - Longer term we're going to need to add some more structured information to the PGProperty enum so this commit gets rid of the convenience variadic constructor as it'd just be confusing down the road.
  • perf: Cache PGProperty values in a map by name - I noticed one of the methods does a loop through all the values to find one matching by name. This commit builds a static cache on class load so the lookups are always O(1). It also does a sanity check that no two entries have the same name.
  • misc: Add PGProperty.getDescription() - Eventually required for automated docs.
  • misc: Add PGProperty.isRequired() - Eventually required for automated docs.
  • misc: Add PGProperty.isDeprecated() - Eventually required for automated docs. This is done via reflection of the @deprecated annotation so should work for any future deprecations as well.
  • misc: Sort PGProperty enum values - This should eliminate most future merge conflicts as long as they continue to maintain the sort order for new values.

Stepping through the docs I noticed the following properties were either not documented or incorrectly referenced:

  • docs: Correct receiveBufferSize and remove duplicate sendBufferSize
  • docs: Add missing binaryTransfer property to head docs
  • docs: Add missing databaseMetadataCacheFields and databaseMetadataCacheFieldsMiB to head docs

This PR does not go through the connection property docs themselves to sort things. There's too many changes that I don't think it's worth the effort. Better to go straight to creating automated docs based on the info that we now have in the enum. I'm going to open a separate issue to track automating the doc generation.

@davecramer davecramer merged commit 47e366d into pgjdbc:master Jan 30, 2020
paplorinc pushed a commit to paplorinc/pgjdbc that referenced this pull request Feb 10, 2020
* origin/master: (427 commits)
  refactor: make PSQLState enum consts for integrity constraint violations (pgjdbc#1699)
  [maven-release-plugin] prepare for next development iteration
  [maven-release-plugin] prepare release REL42.2.10
  pass gpg key through arguments
  add passphrase to release mvn task
  chore: update signing key
  Metadata queries improvment (pgjdbc#1694)
  WIP release notes for 42.2.10 (pgjdbc#1688)
  chore(deps): bump checkstyle from 8.28 to 8.29 in /pgjdbc (pgjdbc#1691)
  Cleanup PGProperty, sort values, and add some missing to docs (pgjdbc#1686)
  fix: Fixes issue pgjdbc#1592 where one thread is reading the copy and another thread closes the connection (pgjdbc#1594)
  Fixing LocalTime rounding (losing precision) (pgjdbc#1570)
  sync error message value with tested value (pgjdbc#1664)
  add DatabaseMetaDataCacheTest to test suite to run it (pgjdbc#1685)
  Fix Network Performance of PgDatabaseMetaData.getTypeInfo() method (pgjdbc#1668)
  fix: Issue pgjdbc#1680 updating a boolean field requires special handling to set it to t or f instead of true or false (pgjdbc#1682)
  fix testSetNetworkTimeoutEnforcement test failure (pgjdbc#1681)
  minor: fix checkstyle violation of unused import (pgjdbc#1683)
  fix: pgjdbc#1677 NumberFormatException when fetching PGInterval with small value (pgjdbc#1678)
  fix: actually use milliseconds instead of microseconds for timeouts (pgjdbc#1653)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants