You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+53-24
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,12 @@ For richer information consult the commit log on github with referenced pull req
4
4
5
5
We do not include break-fix version release in this file.
6
6
7
+
### 7.7.0
8
+
9
+
- Add support for configurable [query timeout](https://github.com/brianc/node-postgres/pull/1760) on a client level.
10
+
7
11
### 7.6.0
12
+
8
13
- Add support for ["bring your own promise"](https://github.com/brianc/node-postgres/pull/1518)
9
14
10
15
### 7.5.0
@@ -56,16 +61,17 @@ We do not include break-fix version release in this file.
56
61
57
62
### v6.1.0
58
63
59
-
- Add optional callback parameter to the pure JavaScript `client.end` method. The native client already supported this.
64
+
- Add optional callback parameter to the pure JavaScript `client.end` method. The native client already supported this.
60
65
61
66
### v6.0.0
62
67
63
68
#### Breaking Changes
64
-
- Remove `pg.pools`. There is still a reference kept to the pools created & tracked by `pg.connect` but it has been renamed, is considered private, and should not be used. Accessing this API directly was uncommon and was _supposed_ to be private but was incorrectly documented on the wiki. Therefore, it is a breaking change of an (unintentionally) public interface to remove it by renaming it & making it private. Eventually `pg.connect` itself will be deprecated in favor of instantiating pools directly via `new pg.Pool()` so this property should become completely moot at some point. In the mean time...check out the new features...
69
+
70
+
- Remove `pg.pools`. There is still a reference kept to the pools created & tracked by `pg.connect` but it has been renamed, is considered private, and should not be used. Accessing this API directly was uncommon and was _supposed_ to be private but was incorrectly documented on the wiki. Therefore, it is a breaking change of an (unintentionally) public interface to remove it by renaming it & making it private. Eventually `pg.connect` itself will be deprecated in favor of instantiating pools directly via `new pg.Pool()` so this property should become completely moot at some point. In the mean time...check out the new features...
65
71
66
72
#### New features
67
73
68
-
- Replace internal pooling code with [pg-pool](https://github.com/brianc/node-pg-pool). This is the first step in eventually deprecating and removing the singleton `pg.connect`. The pg-pool constructor is exported from node-postgres at `require('pg').Pool`. It provides a backwards compatible interface with `pg.connect` as well as a promise based interface & additional niceties.
74
+
- Replace internal pooling code with [pg-pool](https://github.com/brianc/node-pg-pool). This is the first step in eventually deprecating and removing the singleton `pg.connect`. The pg-pool constructor is exported from node-postgres at `require('pg').Pool`. It provides a backwards compatible interface with `pg.connect` as well as a promise based interface & additional niceties.
69
75
70
76
You can now create an instance of a pool and don't have to rely on the `pg` singleton for anything:
Promise support & other goodness lives now in [pg-pool](https://github.com/brianc/node-pg-pool).
84
90
85
-
__Please__ read the readme at [pg-pool](https://github.com/brianc/node-pg-pool) for the full api.
91
+
**Please** read the readme at [pg-pool](https://github.com/brianc/node-pg-pool) for the full api.
86
92
87
-
- Included support for tcp keep alive. Enable it as follows:
93
+
- Included support for tcp keep alive. Enable it as follows:
88
94
89
95
```js
90
-
var client =newClient({ keepAlive:true })
96
+
var client =newClient({ keepAlive:true });
91
97
```
92
98
93
99
This should help with backends incorrectly considering idle clients to be dead and prematurely disconnecting them.
94
100
95
-
96
101
### v5.1.0
102
+
97
103
- Make the query object returned from `client.query` implement the promise interface. This is the first step towards promisifying more of the node-postgres api.
98
104
99
105
Example:
106
+
100
107
```js
101
-
var client =newClient()
102
-
client.connect()
103
-
client.query('SELECT $1::text as name', ['brianc'])
104
-
.then(function(res) {
105
-
console.log('hello from', res.rows[0])
106
-
client.end()
107
-
})
108
+
var client =newClient();
109
+
client.connect();
110
+
client.query("SELECT $1::text as name", ["brianc"]).then(function(res) {
111
+
console.log("hello from", res.rows[0]);
112
+
client.end();
113
+
});
108
114
```
109
115
110
116
### v5.0.0
111
117
112
118
#### Breaking Changes
119
+
113
120
-`require('pg').native` now returns null if the native bindings cannot be found; previously, this threw an exception.
114
121
115
122
#### New Features
123
+
116
124
- better error message when passing `undefined` as a query parameter
117
125
- support for `defaults.connectionString`
118
126
- support for `returnToHead` being passed to [generic pool](https://github.com/coopernurse/node-pool)
119
127
120
128
### v4.5.0
129
+
121
130
- Add option to parse JS date objects in query parameters as [UTC](https://github.com/brianc/node-postgres/pull/943)
122
131
123
132
### v4.4.0
133
+
124
134
- Warn to `stderr` if a named query exceeds 63 characters which is the max length supported by postgres.
125
135
126
136
### v4.3.0
137
+
127
138
- Unpin `pg-types` semver. Allow it to float against `pg-types@1.x`.
128
139
129
140
### v4.2.0
141
+
130
142
- Support for additional error fields in postgres >= 9.3 if available.
131
143
132
144
### v4.1.0
145
+
133
146
- Allow type parser overrides on a [per-client basis](https://github.com/brianc/node-postgres/pull/679)
134
147
135
148
### v4.0.0
149
+
136
150
- Make [native bindings](https://github.com/brianc/node-pg-native.git) an optional install with `npm install pg-native`
137
151
- No longer surround query result callback with `try/catch` block.
138
152
- Remove built in COPY IN / COPY OUT support - better implementations provided by [pg-copy-streams](https://github.com/brianc/node-pg-copy-streams.git) and [pg-native](https://github.com/brianc/node-pg-native.git)
139
153
140
154
### v3.6.0
155
+
141
156
- Include support for (parsing JSONB)[https://github.com/brianc/node-pg-types/pull/13] (supported in postgres 9.4)
142
157
143
158
### v3.5.0
159
+
144
160
- Include support for parsing boolean arrays
145
161
146
162
### v3.4.0
163
+
147
164
- Include port as connection parameter to [unix sockets](https://github.com/brianc/node-postgres/pull/604)
148
165
- Better support for odd [date parsing](https://github.com/brianc/node-pg-types/pull/8)
149
166
@@ -153,7 +170,6 @@ client.query('SELECT $1::text as name', ['brianc'])
153
170
- Expose array parsers on [pg.types](https://github.com/brianc/node-pg-types/pull/2)
154
171
- Allow [pool](https://github.com/brianc/node-postgres/pull/591) to be configured
155
172
156
-
157
173
### v3.1.0
158
174
159
175
- Add [count of the number of times a client has been checked out from the pool](https://github.com/brianc/node-postgres/pull/556)
@@ -162,27 +178,29 @@ client.query('SELECT $1::text as name', ['brianc'])
162
178
### v3.0.0
163
179
164
180
#### Breaking changes
181
+
165
182
-[Parse the DATE PostgreSQL type as local time](https://github.com/brianc/node-postgres/pull/514)
166
183
167
-
After [some discussion](https://github.com/brianc/node-postgres/issues/510) it was decided node-postgres was non-compliant in how it was handling DATE results. They were being converted to UTC, but the PostgreSQL documentation specifies they should be returned in the client timezone. This is a breaking change, and if you use the `date` type you might want to examine your code and make sure nothing is impacted.
184
+
After [some discussion](https://github.com/brianc/node-postgres/issues/510) it was decided node-postgres was non-compliant in how it was handling DATE results. They were being converted to UTC, but the PostgreSQL documentation specifies they should be returned in the client timezone. This is a breaking change, and if you use the `date` type you might want to examine your code and make sure nothing is impacted.
168
185
169
186
-[Fix possible numeric precision loss on numeric & int8 arrays](https://github.com/brianc/node-postgres/pull/501)
170
187
171
-
pg@v2.0 included changes to not convert large integers into their JavaScript number representation because of possibility for numeric precision loss. The same types in arrays were not taken into account. This fix applies the same type of type-coercion rules to arrays of those types, so there will be no more possible numeric loss on an array of very large int8s for example. This is a breaking change because now a return type from a query of `int8[]` will contain _string_ representations
172
-
of the integers. Use your favorite JavaScript bignum module to represent them without precision loss, or punch over the type converter to return the old style arrays again.
188
+
pg@v2.0 included changes to not convert large integers into their JavaScript number representation because of possibility for numeric precision loss. The same types in arrays were not taken into account. This fix applies the same type of type-coercion rules to arrays of those types, so there will be no more possible numeric loss on an array of very large int8s for example. This is a breaking change because now a return type from a query of `int8[]` will contain _string_ representations
189
+
of the integers. Use your favorite JavaScript bignum module to represent them without precision loss, or punch over the type converter to return the old style arrays again.
173
190
174
191
-[Fix to input array of dates being improperly converted to utc](https://github.com/benesch/node-postgres/commit/c41eedc3e01e5527a3d5c242fa1896f02ef0b261#diff-7172adb1fec2457a2700ed29008a8e0aR108)
175
192
176
-
Single `date` parameters were properly sent to the PostgreSQL server properly in local time, but an input array of dates was being changed into utc dates. This is a violation of what PostgreSQL expects. Small breaking change, but none-the-less something you should check out if you are inserting an array of dates.
193
+
Single `date` parameters were properly sent to the PostgreSQL server properly in local time, but an input array of dates was being changed into utc dates. This is a violation of what PostgreSQL expects. Small breaking change, but none-the-less something you should check out if you are inserting an array of dates.
177
194
178
195
-[Query no longer emits `end` event if it ends due to an error](https://github.com/brianc/node-postgres/commit/357b64d70431ec5ca721eb45a63b082c18e6ffa3)
179
196
180
-
This is a small change to bring the semantics of query more in line with other EventEmitters. The tests all passed after this change, but I suppose it could still be a breaking change in certain use cases. If you are doing clever things with the `end` and `error` events of a query object you might want to check to make sure its still behaving normally, though it is most likely not an issue.
197
+
This is a small change to bring the semantics of query more in line with other EventEmitters. The tests all passed after this change, but I suppose it could still be a breaking change in certain use cases. If you are doing clever things with the `end` and `error` events of a query object you might want to check to make sure its still behaving normally, though it is most likely not an issue.
The long & short of it is now any object you supply in the list of query values will be inspected for a `.toPostgres` method. If the method is present it will be called and its result used as the raw text value sent to PostgreSQL for that value. This allows the same type of custom type coercion on query parameters as was previously afforded to query result values.
203
+
The long & short of it is now any object you supply in the list of query values will be inspected for a `.toPostgres` method. If the method is present it will be called and its result used as the raw text value sent to PostgreSQL for that value. This allows the same type of custom type coercion on query parameters as was previously afforded to query result values.
@@ -197,41 +215,52 @@ Avoids a scenario where your pool could fill up with disconnected & unusable cli
197
215
To provide better documentation and a clearer explanation of how to override the query result parsing system we broke the type converters [into their own module](https://github.com/brianc/node-pg-types). There is still work around removing the 'global-ness' of the type converters so each query or connection can return types differently, but this is a good first step and allow a lot more obvious way to return int8 results as JavaScript numbers, for example
198
216
199
217
### v2.11.0
218
+
200
219
- Add support for [application_name](https://github.com/brianc/node-postgres/pull/497)
201
220
202
221
### v2.10.0
222
+
203
223
- Add support for [the password file](http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html)
204
224
205
225
### v2.9.0
226
+
206
227
- Add better support for [unix domain socket](https://github.com/brianc/node-postgres/pull/487) connections
207
228
208
229
### v2.8.0
230
+
209
231
- Add support for parsing JSON[] and UUID[] result types
210
232
211
233
### v2.7.0
234
+
212
235
- Use single row mode in native bindings when available [@rpedela]
213
236
- reduces memory consumption when handling row values in 'row' event
214
237
- Automatically bind buffer type parameters as binary [@eugeneware]
215
238
216
239
### v2.6.0
240
+
217
241
- Respect PGSSLMODE environment variable
218
242
219
243
### v2.5.0
244
+
220
245
- Ability to opt-in to int8 parsing via `pg.defaults.parseInt8 = true`
221
246
222
247
### v2.4.0
248
+
223
249
- Use eval in the result set parser to increase performance
224
250
225
251
### v2.3.0
252
+
226
253
- Remove built-in support for binary Int64 parsing.
227
-
_Due to the low usage & required compiled dependency this will be pushed into a 3rd party add-on_
254
+
_Due to the low usage & required compiled dependency this will be pushed into a 3rd party add-on_
228
255
229
256
### v2.2.0
257
+
230
258
-[Add support for excapeLiteral and escapeIdentifier in both JavaScript and the native bindings](https://github.com/brianc/node-postgres/pull/396)
231
259
232
260
### v2.1.0
261
+
233
262
- Add support for SSL connections in JavaScript driver
234
-
- this means you can connect to heroku postgres from your local machine without the native bindings!
263
+
- this means you can connect to heroku postgres from your local machine without the native bindings!
235
264
-[Add field metadata to result object](https://github.com/brianc/node-postgres/blob/master/test/integration/client/row-description-on-results-tests.js)
236
265
-[Add ability for rows to be returned as arrays instead of objects](https://github.com/brianc/node-postgres/blob/master/test/integration/client/results-as-array-tests.js)
237
266
@@ -267,7 +296,7 @@ If you are unhappy with these changes you can always [override the built in type
267
296
### v1.0.0
268
297
269
298
- remove deprecated functionality
270
-
- Callback function passed to `pg.connect` now __requires__ 3 arguments
299
+
- Callback function passed to `pg.connect` now **requires** 3 arguments
0 commit comments