Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: brianc/node-postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.4.2
Choose a base ref
...
head repository: brianc/node-postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref

Commits on Jun 8, 2017

  1. Remove fallbacks for unsupported Node versions (#1304)

    * Remove unsupported Node versions 0.10 and 0.12 from CI
    
    * Replace deprecated Buffer constructor with .from/.alloc
    
    * Remove Promise polyfill
    
    * Make use of Object.assign
    
    * Remove checks for versions of Node earlier than 4
    
    * Remove Buffer#indexOf fallback for Node 0.10
    charmander authored and brianc committed Jun 8, 2017
    Copy the full SHA
    934ca3a View commit details

Commits on Jun 9, 2017

  1. Remove fallbacks for unsupported Node versions (#1304) (#1313)

    * Add client connectionString tests (#1310)
    
    * Remove redundant tests
    
    * Add client connectionString test
    
    Add test to ensure { connectionString } is respected as an argument to the client constructor
    
    * Add test for connection string property
    
    Also fixed some legacy require statements.
    
    * Normalize native error properties
    
    Map native error properties to the same property names we use for errors from the JS driver.
    
    Fixes #972
    Fixes #938
    brianc authored Jun 9, 2017
    Copy the full SHA
    aeb0c75 View commit details
  2. Remove default and normalize Travis-CI matrix

    Removes the default node 6 / PG 9.6 combination and adds it to the
    Travis-CI matrix of combinations. That way all combinations are
    defined in a single place.
    sehrope authored and brianc committed Jun 9, 2017
    Copy the full SHA
    f691088 View commit details
  3. Add node 8.x to Travis-CI matrix

    sehrope authored and brianc committed Jun 9, 2017
    Copy the full SHA
    61921aa View commit details
  4. Copy the full SHA
    31ee759 View commit details
  5. Copy the full SHA
    272858c View commit details
  6. Use built-in util.deprecate

    brianc committed Jun 9, 2017
    Copy the full SHA
    bbbd6e9 View commit details
  7. Merge origin/master

    brianc committed Jun 9, 2017
    Copy the full SHA
    a829eee View commit details

Commits on Jun 15, 2017

  1. Added MIT License

    amilajack authored and brianc committed Jun 15, 2017
    Copy the full SHA
    bc00f90 View commit details
  2. Create LICENSE

    brianc committed Jun 15, 2017
    Copy the full SHA
    25a98f5 View commit details
  3. Copy the full SHA
    6d98b08 View commit details
  4. Fix unit tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    96b7fc3 View commit details
  5. Start fixing integration tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    2f3d72a View commit details
  6. Copy the full SHA
    b8c2beb View commit details
  7. Copy the full SHA
    e284cfc View commit details
  8. Make almost all tests pass

    brianc committed Jun 15, 2017
    Copy the full SHA
    2add7e3 View commit details
  9. Fix remainder of error tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    d3ec938 View commit details
  10. Copy the full SHA
    970d83a View commit details
  11. Restructure native file paths

    Make file paths more closely match the non-native files, to make auto-complete file names slightly easier.
    brianc committed Jun 15, 2017
    Copy the full SHA
    df36bec View commit details
  12. Copy the full SHA
    55c3b36 View commit details
  13. Copy the full SHA
    bc2f550 View commit details
  14. Start working on promsie tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    02bcc9d View commit details
  15. WIP

    brianc committed Jun 15, 2017
    Copy the full SHA
    3a7b226 View commit details
  16. Working on disconnect issue

    brianc committed Jun 15, 2017
    Copy the full SHA
    7256085 View commit details
  17. Work on test

    brianc committed Jun 15, 2017
    Copy the full SHA
    f41839b View commit details
  18. All tests passing

    brianc committed Jun 15, 2017
    Copy the full SHA
    3219db9 View commit details
  19. Almost all tests passing

    brianc committed Jun 15, 2017
    Copy the full SHA
    c961c90 View commit details
  20. Make all tests pass

    brianc committed Jun 15, 2017
    Copy the full SHA
    2c3f55e View commit details
  21. Tidy up a bit of testing

    brianc committed Jun 15, 2017
    Copy the full SHA
    3074436 View commit details
  22. Start cleaning up tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    d615ebe View commit details
  23. Format more tests

    brianc committed Jun 15, 2017
    Copy the full SHA
    f12eb0a View commit details
  24. Test cleanup

    brianc committed Jun 15, 2017
    Copy the full SHA
    132861f View commit details
  25. Remove failing travis test

    brianc committed Jun 15, 2017
    Copy the full SHA
    e100152 View commit details
  26. Add co to dev deps

    brianc committed Jun 15, 2017
    Copy the full SHA
    a4b42ac View commit details

Commits on Jun 17, 2017

  1. Move attach listeners into its own function

    Just for readability
    brianc committed Jun 17, 2017
    Copy the full SHA
    fc36340 View commit details
  2. Copy the full SHA
    5f5e40f View commit details
  3. Fix brittle unit tests

    brianc committed Jun 17, 2017
    Copy the full SHA
    0ce8a6c View commit details
  4. Add event-emitters back

    brianc committed Jun 17, 2017
    Copy the full SHA
    76c1000 View commit details
  5. Copy the full SHA
    cfd9caa View commit details
  6. Merge branch 'master' into 7.0

    brianc committed Jun 17, 2017
    Copy the full SHA
    63b23bc View commit details

Commits on Jun 18, 2017

  1. Update engine support

    brianc committed Jun 18, 2017
    Copy the full SHA
    94a628a View commit details
  2. Cleanup

    brianc committed Jun 18, 2017
    Copy the full SHA
    313c41a View commit details
  3. Remove deprecated methods

    brianc committed Jun 18, 2017
    Copy the full SHA
    1bc1758 View commit details
  4. Cleanup a bit of dead code

    brianc committed Jun 18, 2017
    Copy the full SHA
    2300445 View commit details
  5. Copy the full SHA
    ed9a33d View commit details
  6. Tweak travis node versions

    brianc committed Jun 18, 2017
    Copy the full SHA
    49c5976 View commit details
  7. Add use strict to every file

    brianc committed Jun 18, 2017
    Copy the full SHA
    0f1f862 View commit details
  8. Tweak travis.yml

    brianc committed Jun 18, 2017
    Copy the full SHA
    729d4e9 View commit details
  9. Copy the full SHA
    bd87cdd View commit details
  10. Add query validity check

    Passing nothing for both the query.text and query.name is unsupported but previously crashed with an impossible to catch error.
    brianc committed Jun 18, 2017
    Copy the full SHA
    da71ea5 View commit details
Showing with 6,106 additions and 6,347 deletions.
  1. +6 −0 .eslintrc
  2. +0 −5 .jshintrc
  3. +12 −21 .travis.yml
  4. +17 −7 CHANGELOG.md
  5. +7 −5 Makefile
  6. +320 −287 lib/client.js
  7. +80 −80 lib/connection-parameters.js
  8. +500 −521 lib/connection.js
  9. +28 −27 lib/defaults.js
  10. +39 −93 lib/index.js
  11. +226 −0 lib/native/client.js
  12. +2 −234 lib/native/index.js
  13. +135 −134 lib/native/query.js
  14. +0 −36 lib/native/result.js
  15. +0 −17 lib/pool-factory.js
  16. +170 −176 lib/query.js
  17. +83 −82 lib/result.js
  18. +23 −22 lib/type-overrides.js
  19. +84 −102 lib/utils.js
  20. +13 −11 package.json
  21. +40 −42 script/create-test-tables.js
  22. +13 −13 script/dump-db-types.js
  23. +6 −5 script/list-db-types.js
  24. +54 −53 test/buffer-list.js
  25. +19 −18 test/cli.js
  26. +192 −157 test/integration/client/api-tests.js
  27. +79 −76 test/integration/client/appname-tests.js
  28. +141 −130 test/integration/client/array-tests.js
  29. +60 −54 test/integration/client/big-simple-query-tests.js
  30. +0 −40 test/integration/client/cancel-query-tests.js
  31. +39 −42 test/integration/client/configuration-tests.js
  32. +17 −15 test/integration/client/custom-types-tests.js
  33. +0 −23 test/integration/client/deprecation-tests.js
  34. +17 −14 test/integration/client/empty-query-tests.js
  35. +0 −6 test/integration/client/end-callback-tests.js
  36. +191 −184 test/integration/client/error-handling-tests.js
  37. +0 −39 test/integration/client/force-native-with-envvar-tests.js
  38. +17 −17 test/integration/client/huge-numeric-tests.js
  39. +27 −37 test/integration/client/json-type-parsing-tests.js
  40. +69 −0 test/integration/client/multiple-results-tests.js
  41. +18 −20 test/integration/client/network-partition-tests.js
  42. +18 −20 test/integration/client/no-data-tests.js
  43. +25 −20 test/integration/client/no-row-result-tests.js
  44. +50 −39 test/integration/client/notice-tests.js
  45. +28 −24 test/integration/client/parse-int-8-tests.js
  46. +103 −175 test/integration/client/prepared-statement-tests.js
  47. +50 −0 test/integration/client/promise-api-tests.js
  48. +27 −27 test/integration/client/query-as-promise-tests.js
  49. +14 −12 test/integration/client/query-column-names-tests.js
  50. +80 −70 test/integration/client/query-error-handling-prepared-statement-tests.js
  51. +14 −13 test/integration/client/query-error-handling-tests.js
  52. +6 −5 test/integration/client/quick-disconnect-tests.js
  53. +28 −32 test/integration/client/result-metadata-tests.js
  54. +23 −25 test/integration/client/results-as-array-tests.js
  55. +33 −32 test/integration/client/row-description-on-results-tests.js
  56. +74 −93 test/integration/client/simple-query-tests.js
  57. +13 −12 test/integration/client/ssl-tests.js
  58. +3 −2 test/integration/client/test-helper.js
  59. +28 −23 test/integration/client/timezone-tests.js
  60. +58 −54 test/integration/client/transaction-tests.js
  61. +134 −141 test/integration/client/type-coercion-tests.js
  62. +32 −29 test/integration/client/type-parser-override-tests.js
  63. +10 −0 test/integration/connection-pool/connection-pool-size-tests.js
  64. +0 −2 test/integration/connection-pool/double-connection-tests.js
  65. +0 −15 test/integration/connection-pool/ending-empty-pool-tests.js
  66. +0 −30 test/integration/connection-pool/ending-pool-tests.js
  67. +45 −35 test/integration/connection-pool/error-tests.js
  68. +11 −13 test/integration/connection-pool/idle-timeout-tests.js
  69. +0 −2 test/integration/connection-pool/max-connection-tests.js
  70. +3 −2 test/integration/connection-pool/native-instance-tests.js
  71. +0 −20 test/integration/connection-pool/optional-config-tests.js
  72. +0 −2 test/integration/connection-pool/single-connection-tests.js
  73. +0 −13 test/integration/connection-pool/single-pool-on-object-config-tests.js
  74. +23 −24 test/integration/connection-pool/test-helper.js
  75. +0 −2 test/integration/connection-pool/waiting-connection-tests.js
  76. +0 −28 test/integration/connection-pool/yield-support-body.js
  77. +20 −5 test/integration/connection-pool/yield-support-tests.js
  78. +52 −54 test/integration/connection/bound-command-tests.js
  79. +24 −23 test/integration/connection/copy-tests.js
  80. +15 −14 test/integration/connection/notification-tests.js
  81. +24 −23 test/integration/connection/query-tests.js
  82. +37 −36 test/integration/connection/test-helper.js
  83. +43 −48 test/integration/domain-tests.js
  84. +20 −18 test/integration/gh-issues/130-tests.js
  85. +19 −17 test/integration/gh-issues/131-tests.js
  86. +14 −13 test/integration/gh-issues/199-tests.js
  87. +8 −6 test/integration/gh-issues/507-tests.js
  88. +48 −45 test/integration/gh-issues/600-tests.js
  89. +22 −20 test/integration/gh-issues/675-tests.js
  90. +6 −2 test/integration/gh-issues/699-tests.js
  91. +9 −7 test/integration/gh-issues/787-tests.js
  92. +9 −8 test/integration/gh-issues/882-tests.js
  93. +20 −9 test/integration/gh-issues/981-tests.js
  94. +22 −22 test/integration/test-helper.js
  95. +27 −25 test/native/callback-api-tests.js
  96. +0 −36 test/native/connection-tests.js
  97. +0 −68 test/native/error-tests.js
  98. +63 −88 test/native/evented-api-tests.js
  99. +5 −4 test/native/missing-native.js
  100. +21 −0 test/native/native-vs-js-error-tests.js
  101. +40 −38 test/native/stress-tests.js
  102. +85 −0 test/suite.js
  103. +79 −78 test/test-buffers.js
  104. +158 −165 test/test-helper.js
  105. +15 −15 test/unit/client/cleartext-password-tests.js
  106. +125 −128 test/unit/client/configuration-tests.js
  107. +14 −20 test/unit/client/early-disconnect-tests.js
  108. +38 −37 test/unit/client/escape-tests.js
  109. +22 −20 test/unit/client/md5-password-tests.js
  110. +7 −7 test/unit/client/notification-tests.js
  111. +73 −71 test/unit/client/prepared-statement-tests.js
  112. +45 −44 test/unit/client/query-queue-tests.js
  113. +22 −24 test/unit/client/result-metadata-tests.js
  114. +113 −117 test/unit/client/simple-query-tests.js
  115. +26 −25 test/unit/client/stream-and-query-error-interaction-tests.js
  116. +19 −17 test/unit/client/test-helper.js
  117. +67 −110 test/unit/client/throw-in-type-parser-tests.js
  118. +187 −187 test/unit/connection-parameters/creation-tests.js
  119. +98 −99 test/unit/connection-parameters/environment-variable-tests.js
  120. +29 −28 test/unit/connection/error-tests.js
  121. +285 −291 test/unit/connection/inbound-parser-tests.js
  122. +123 −123 test/unit/connection/outbound-sending-tests.js
  123. +69 −72 test/unit/connection/startup-tests.js
  124. +2 −1 test/unit/connection/test-helper.js
  125. +27 −23 test/unit/test-helper.js
  126. +133 −135 test/unit/utils-tests.js
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "standard",
"rules": {
"no-new-func": "off"
}
}
5 changes: 0 additions & 5 deletions .jshintrc

This file was deleted.

33 changes: 12 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,39 +6,30 @@ before_script:
env:
- CC=clang CXX=clang++ npm_config_clang=1 PGUSER=postgres PGDATABASE=postgres

node_js: "6"
addons:
postgresql: "9.6"

matrix:
include:
- node_js: "0.10"
addons:
postgresql: "9.6"
env: []
- node_js: "0.12"
- node_js: "lts/argon"
addons:
postgresql: "9.6"
env: []
- node_js: "4"
addons:
postgresql: "9.6"
- node_js: "5"
addons:
postgresql: "9.6"
- node_js: "6"
- node_js: "lts/boron"
addons:
postgresql: "9.1"
dist: precise
- node_js: "6"
- node_js: "lts/boron"
addons:
postgresql: "9.2"
- node_js: "6"
- node_js: "lts/boron"
addons:
postgresql: "9.3"
- node_js: "6"
- node_js: "lts/boron"
addons:
postgresql: "9.4"
- node_js: "6"
- node_js: "lts/boron"
addons:
postgresql: "9.5"
- node_js: "lts/boron"
addons:
postgresql: "9.6"
- node_js: "8"
addons:
postgresql: "9.6"
24 changes: 17 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,15 +4,25 @@ For richer information consult the commit log on github with referenced pull req

We do not include break-fix version release in this file.

### v6.4.0
### 7.0.0

- Add support for passing `client_encoding` as a connection parameter. Used when decoding strings in the JavaScript driver. The default is still `utf8`.
#### Breaking Changes

- Drop support for node < `4.x`.
- Remove `pg.connect` `pg.end` and `pg.cancel` singleton methods.
- `Client#connect(callback)` now returns `undefined`. It used to return an event emitter.
- Upgrade [pg-pool](https://github.com/brianc/node-pg-pool) to `2.x`.
- Upgrade [pg-native](https://github.com/brianc/node-pg-native) to `2.x`.
- Standardize error message fields between JS and native driver. The only breaking changes were in the native driver as its field names were brought into alignment with the existing JS driver field names.
- Result from multi-statement text queries such as `SELECT 1; SELECT 2;` are now returned as an array of results instead of a single result with 1 array containing rows from both queries.

[Please see here for a migration guide](https://node-postgres.com/guides/upgrading)

### v6.3.0
#### Enhancements

- Deprecate `pg.connect` `pg.end` and `pg.cancel` - favor using `new pg.Pool()` instead of pg singleton.
- Deprecate undocumented but possibly used `query.promise()` method. Use the promise returned directly from `client.query` / `pool.query`.
- Deprecate returning an automatically created query result from `client.query`. Instead return more idomatic responses for callback/promise methods.
- Overhauled documentation: [https://node-postgres.com](https://node-postgres.com).
- Add `Client#connect() => Promise<void>` and `Client#end() => Promise<void>` calls. Promises are now returned from all async methods on clients _if and only if_ no callback was supplied to the method.
- Add `connectionTimeoutMillis` to pg-pool.

### v6.2.0

@@ -214,7 +224,7 @@ decimal | string | number (float)
```

For more information see https://github.com/brianc/node-postgres/pull/353
If you are unhappy with these changes you can always [override the built in type parsing fairly easily](https://github.com/brianc/node-pg-parse-float).
If you are unhappy with these changes you can always [override the built in type parsing fairly easily](https://github.com/brianc/node-pg-parse-float).

### v1.3.0

12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ params := $(connectionString)
node-command := xargs -n 1 -I file node file $(params)

.PHONY : test test-connection test-integration bench test-native \
jshint publish test-missing-native update-npm
lint publish test-missing-native update-npm

all:
npm install
@@ -17,7 +17,7 @@ help:

test: test-unit

test-all: jshint test-missing-native test-unit test-integration test-native test-binary
test-all: lint test-missing-native test-unit test-integration test-native


update-npm:
@@ -36,8 +36,10 @@ test-connection:
test-missing-native:
@echo "***Testing optional native install***"
@rm -rf node_modules/pg-native
@rm -rf node_modules/libpq
@node test/native/missing-native.js
@rm -rf node_modules/pg-native
@rm -rf node_modules/libpq

node_modules/pg-native/index.js:
@npm i pg-native
@@ -58,6 +60,6 @@ test-binary: test-connection
test-pool:
@find test/integration/connection-pool -name "*.js" | $(node-command) binary

jshint:
@echo "***Starting jshint***"
@./node_modules/.bin/jshint lib
lint:
@echo "***Starting lint***"
eslint lib
Loading