File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
SHELL := /bin/bash
2
2
3
- connectionString =pg://postgres:5432@localhost/postgres
3
+ connectionString =pg://
4
4
5
5
params := $(connectionString )
6
6
7
7
node-command := xargs -n 1 -I file node file $(params )
8
8
9
9
.PHONY : test test-connection test-integration bench test-native build/default/binding.node
10
+
11
+ help :
12
+ echo " make test-all connectionString=pg://<your connection string>"
13
+
10
14
test : test-unit
11
15
12
16
test-all : test-unit test-integration test-native test-binary
Original file line number Diff line number Diff line change 1
- var config = require ( __dirname + '/../lib/utils' ) . parseConnectionString ( process . argv [ 2 ] )
1
+ var config = { } ;
2
+ if ( process . argv [ 2 ] ) {
3
+ config = require ( __dirname + '/../lib/utils' ) . parseConnectionString ( process . argv [ 2 ] ) ;
4
+ }
5
+ //TODO use these environment variables in lib/ code
6
+ //http://www.postgresql.org/docs/8.4/static/libpq-envars.html
7
+ config . host = config . host || process . env [ 'PGHOST' ] || process . env [ 'PGHOSTADDR' ] ;
8
+ config . port = config . port || process . env [ 'PGPORT' ] ;
9
+ config . database = config . database || process . env [ 'PGDATABASE' ] ;
10
+ config . user = config . user || process . env [ 'PGUSER' ] ;
11
+ config . password = config . password || process . env [ 'PGPASSWORD' ] ;
2
12
3
13
for ( var i = 0 ; i < process . argv . length ; i ++ ) {
4
14
switch ( process . argv [ i ] . toLowerCase ( ) ) {
You can’t perform that action at this time.
0 commit comments