We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe74b91 commit d5bd9c9Copy full SHA for d5bd9c9
lib/defaults.js
@@ -1,10 +1,10 @@
1
module.exports = {
2
//database user's name
3
- user: '',
+ user: process.env.USER,
4
//name of database to connect
5
- database: '',
+ database: process.env.USER,
6
//database user's password
7
- password: '',
+ password: null,
8
//database port
9
port: 5432,
10
//number of rows to return at a time from a prepared statement's
test/unit/client/configuration-tests.js
@@ -4,8 +4,8 @@ test('client settings', function() {
test('defaults', function() {
var client = new Client();
- assert.equal(client.user, '');
- assert.equal(client.database, '');
+ assert.equal(client.user, process.env.USER);
+ assert.equal(client.database, process.env.USER);
assert.equal(client.port, 5432);
});
11
@@ -41,11 +41,11 @@ test('initializing from a config string', function() {
41
42
test('when not including all values the defaults are used', function() {
43
var client = new Client("pg://host1")
44
- assert.equal(client.user, "")
45
- assert.equal(client.password, "")
+ assert.equal(client.user, process.env.USER)
+ assert.equal(client.password, null)
46
assert.equal(client.host, "host1")
47
assert.equal(client.port, 5432)
48
- assert.equal(client.database, "")
+ assert.equal(client.database, process.env.USER)
49
})
50
51
0 commit comments