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.0.1
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: v6.0.2
Choose a head ref
  • 3 commits
  • 14 files changed
  • 3 contributors

Commits on Jun 24, 2016

  1. Resolve merge conflict in PR #1041 (#1065)

    * Add license comment
    
    * Delete pool.js
    Illirik Smirnov authored and brianc committed Jun 24, 2016
    Copy the full SHA
    522d622 View commit details

Commits on Jul 10, 2016

  1. Copy the full SHA
    33a1c35 View commit details
  2. Bump version

    brianc committed Jul 10, 2016
    Copy the full SHA
    bd7fc59 View commit details
Showing with 120 additions and 2 deletions.
  1. +22 −0 README.md
  2. +8 −0 lib/client.js
  3. +9 −1 lib/connection-parameters.js
  4. +8 −0 lib/connection.js
  5. +8 −0 lib/defaults.js
  6. +8 −0 lib/index.js
  7. +8 −0 lib/native/index.js
  8. +8 −0 lib/native/query.js
  9. +8 −0 lib/native/result.js
  10. +8 −0 lib/query.js
  11. +8 −0 lib/result.js
  12. +8 −0 lib/type-overrides.js
  13. +8 −0 lib/utils.js
  14. +1 −1 package.json
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -109,6 +109,28 @@ It's __highly recommended__ you read the documentation for [pg-pool](https://git

[Here is an up & running quickly example](https://github.com/brianc/node-postgres/wiki/Example)

### connect to self signed Postgresql server

Use following config to connect a Postgresql Server self signed:

```
var config = {
database : 'database-name', //env var: PGDATABASE
host : "host-or-ip", //env var: PGPORT
port : 5432, //env var: PGPORT
max : 100, // max number of clients in the pool
idleTimeoutMillis: 30000,
ssl : {
rejectUnauthorized : false,
ca : fs.readFileSync("/path/to/server-certificates/maybe/root.crt").toString(),
key : fs.readFileSync("/path/to/client-key/maybe/postgresql.key").toString(),
cert : fs.readFileSync("/path/to/client-certificates/maybe/postgresql.crt").toString(),
}
};
```

For more information about `config.ssl` check [TLS (SSL) of nodejs](https://nodejs.org/dist/latest-v4.x/docs/api/tls.html)

## [More Documentation](https://github.com/brianc/node-postgres/wiki)

8 changes: 8 additions & 0 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var crypto = require('crypto');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
10 changes: 9 additions & 1 deletion lib/connection-parameters.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var url = require('url');
var dns = require('dns');

@@ -47,7 +55,7 @@ var ConnectionParameters = function(config) {
this.host = val('host', config);
this.password = val('password', config);
this.binary = val('binary', config);
this.ssl = typeof config.ssl === 'boolean' ? config.ssl : useSsl();
this.ssl = typeof config.ssl === 'undefined' ? useSsl() : config.ssl;
this.client_encoding = val("client_encoding", config);
//a domain socket begins with '/'
this.isDomainSocket = (!(this.host||'').indexOf('/'));
8 changes: 8 additions & 0 deletions lib/connection.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var net = require('net');
var EventEmitter = require('events').EventEmitter;
var util = require('util');
8 changes: 8 additions & 0 deletions lib/defaults.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var defaults = module.exports = {
// database host. defaults to localhost
host: 'localhost',
8 changes: 8 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var EventEmitter = require('events').EventEmitter;
var util = require('util');
var Client = require('./client');
8 changes: 8 additions & 0 deletions lib/native/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var Native = require('pg-native');
var TypeOverrides = require('../type-overrides');
var semver = require('semver');
8 changes: 8 additions & 0 deletions lib/native/query.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var EventEmitter = require('events').EventEmitter;
var util = require('util');
var utils = require('../utils');
8 changes: 8 additions & 0 deletions lib/native/result.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var NativeResult = module.exports = function(pq) {
this.command = null;
this.rowCount = 0;
8 changes: 8 additions & 0 deletions lib/query.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var EventEmitter = require('events').EventEmitter;
var util = require('util');

8 changes: 8 additions & 0 deletions lib/result.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var types = require('pg-types');

//result object returned from query
8 changes: 8 additions & 0 deletions lib/type-overrides.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var types = require('pg-types');

function TypeOverrides(userTypes) {
8 changes: 8 additions & 0 deletions lib/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/**
* Copyright (c) 2010-2016 Brian Carlson (brian.m.carlson@gmail.com)
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* README.md file in the root directory of this source tree.
*/

var defaults = require('./defaults');

// convert a JS array to a postgres array literal
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pg",
"version": "6.0.1",
"version": "6.0.2",
"description": "PostgreSQL client - pure javascript & libpq with the same API",
"keywords": [
"postgres",